19 #ifndef INCLUDE_RCF_MEMSTREAM_HPP
20 #define INCLUDE_RCF_MEMSTREAM_HPP
26 #include <boost/cstdint.hpp>
28 #include <boost/noncopyable.hpp>
30 #include <RCF/Config.hpp>
31 #include <RCF/ByteBuffer.hpp>
38 public std::streambuf,
42 MemIstreamBuf(
char * buffer = NULL, std::size_t bufferLen = 0);
44 void reset(
char * buffer, std::size_t bufferLen);
47 std::streambuf::int_type underflow();
51 std::ios_base::seekdir dir,
52 std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out);
55 std::size_t mBufferLen;
61 public std::basic_istream<char>
64 MemIstream(
const char * buffer = NULL, std::size_t bufferLen = 0);
66 void reset(
const char * buffer, std::size_t bufferLen);
70 MemIstreamBuf * mpBuf;
76 public std::streambuf,
84 std::streambuf::int_type overflow(std::streambuf::int_type ch);
88 std::ios_base::seekdir dir,
89 std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out);
91 friend class MemOstream;
92 ReallocBuffer mWriteBuffer;
97 class RCF_EXPORT MemOstream :
98 public std::basic_ostream<char>
106 std::size_t capacity();
110 MemOstreamBuf * mpBuf;
113 typedef boost::shared_ptr<MemOstream> MemOstreamPtr;