35 #ifndef IE_CORE_MEMORYSTREAM_H
36 #define IE_CORE_MEMORYSTREAM_H
38 #include "boost/iostreams/categories.hpp"
39 #include "boost/iostreams/detail/ios.hpp"
40 #include "boost/iostreams/detail/fstream.hpp"
41 #include "boost/iostreams/operations.hpp"
43 #include "IECore/Export.h"
44 #include "IECore/RefCounted.h"
54 :
public boost::iostreams::device_tag
62 MemoryStream(
char *buf, std::streamsize sz,
bool ownsBuf =
false );
65 std::streamsize read(
char* s, std::streamsize n);
68 std::streamsize write(
const char* s, std::streamsize n);
71 void get(
char *& data, std::streamsize &sz )
const;
79 Impl(
char *buf, std::streamsize sz,
bool ownsBuf =
false );
83 std::streamsize read(
char* s, std::streamsize n);
85 std::streamsize write(
const char* s, std::streamsize n);
90 std::streamsize m_size;
91 std::streamsize m_bufSize;
96 IE_CORE_DECLAREPTR( Impl );
102 typedef char char_type;
103 typedef boost::iostreams::source_tag category;
108 MemoryStreamSource(
char *buf, std::streamsize sz,
bool ownsBuf =
false);
111 struct MemoryStreamSink :
private MemoryStream
113 typedef char char_type;
114 typedef boost::iostreams::sink_tag category;
124 #endif // IE_CORE_MEMORYSTREAM_H
A boost.iostreams "device" for reading to/writing from memory.
Definition: MemoryStream.h:50
std::streamsize read(char *s, std::streamsize n)
Read from the stream.
void get(char *&data, std::streamsize &sz) const
Retrieve a reference to the contents of the stream.
std::streamsize write(const char *s, std::streamsize n)
Write to the stream.
Definition: RefCounted.h:124
This namespace contains all components of the core library.
Definition: AddSmoothSkinningInfluencesOp.h:43