1 #include "yaml-cpp/ostream.h"
6 ostream::ostream(): m_buffer(0), m_pos(0), m_size(0), m_row(0), m_col(0)
16 void ostream::reserve(unsigned size
)
21 char *newBuffer
= new char[size
];
22 std::memset(newBuffer
, 0, size
* sizeof(char));
23 std::memcpy(newBuffer
, m_buffer
, m_size
* sizeof(char));
29 void ostream::put(char ch
)
31 if(m_pos
>= m_size
- 1) // an extra space for the NULL terminator
44 ostream
& operator << (ostream
& out
, const char *str
)
46 std::size_t length
= std::strlen(str
);
47 for(std::size_t i
=0;i
<length
;i
++)
52 ostream
& operator << (ostream
& out
, const std::string
& str
)
58 ostream
& operator << (ostream
& out
, char ch
)