00001 #pragma once 00002 00003 #ifndef OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00004 #define OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00005 00006 00007 #include <string> 00008 00009 namespace YAML 00010 { 00011 class ostream 00012 { 00013 public: 00014 ostream(); 00015 ~ostream(); 00016 00017 void reserve(unsigned size); 00018 void put(char ch); 00019 const char *str() const { return m_buffer; } 00020 00021 unsigned row() const { return m_row; } 00022 unsigned col() const { return m_col; } 00023 unsigned pos() const { return m_pos; } 00024 00025 private: 00026 char *m_buffer; 00027 unsigned m_pos; 00028 unsigned m_size; 00029 00030 unsigned m_row, m_col; 00031 }; 00032 00033 ostream& operator << (ostream& out, const char *str); 00034 ostream& operator << (ostream& out, const std::string& str); 00035 ostream& operator << (ostream& out, char ch); 00036 } 00037 00038 #endif // OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66