![]() |
zeep::char_streambuf — A simple class to use const char buffers as streambuf.
// In header: <zeep/streambuf.hpp> class char_streambuf : public streambuf { public: // construct/copy/destruct char_streambuf(const char *, size_t); char_streambuf(const char *); char_streambuf(const char_streambuf &) = delete; char_streambuf & operator=(const char_streambuf &) = delete; // private member functions int_type underflow(); int_type uflow(); int_type pbackfail(int_type); std::streamsize showmanyc(); pos_type seekoff(std::streambuf::off_type, std::ios_base::seekdir, std::ios_base::openmode); pos_type seekpos(std::streambuf::pos_type, std::ios_base::openmode); };
It is very often useful to have a streambuf class that can wrap wrap around a const char* pointer.
char_streambuf
public
construct/copy/destructchar_streambuf(const char * buffer, size_t length);constructor taking a buffer and a length
char_streambuf(const char * buffer);constructor taking a buffer using the standard strlen to determine the length
char_streambuf(const char_streambuf &) = delete;
char_streambuf & operator=(const char_streambuf &) = delete;