libzeep

PrevUpHomeNext

Class char_streambuf

zeep::char_streambuf — A simple class to use const char buffers as streambuf.

Synopsis

// 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);
};

Description

It is very often useful to have a streambuf class that can wrap wrap around a const char* pointer.

char_streambuf public construct/copy/destruct

  1. char_streambuf(const char * buffer, size_t length);
    constructor taking a buffer and a length
  2. char_streambuf(const char * buffer);
    constructor taking a buffer using the standard strlen to determine the length
  3. char_streambuf(const char_streambuf &) = delete;
  4. char_streambuf & operator=(const char_streambuf &) = delete;

char_streambuf private member functions

  1. int_type underflow();
  2. int_type uflow();
  3. int_type pbackfail(int_type ch);
  4. std::streamsize showmanyc();
  5. pos_type seekoff(std::streambuf::off_type off, std::ios_base::seekdir dir, 
                     std::ios_base::openmode which);
  6. pos_type seekpos(std::streambuf::pos_type pos, std::ios_base::openmode which);

PrevUpHomeNext