18 #ifndef INCLUDE_RCF_BYTEBUFFER_HPP 19 #define INCLUDE_RCF_BYTEBUFFER_HPP 26 #include <RCF/Export.hpp> 31 typedef std::shared_ptr<MemOstream> MemOstreamPtr;
34 typedef std::shared_ptr<ReallocBuffer> ReallocBufferPtr;
50 const std::vector<char> & vc);
54 const std::string & s);
58 std::shared_ptr<std::vector<char> > spvc,
59 bool readOnly =
false);
63 ReallocBufferPtr sprb,
64 bool readOnly =
false);
69 bool readOnly =
false);
74 bool readOnly =
false);
79 std::size_t leftMargin,
80 bool readOnly =
false);
85 std::shared_ptr<MemOstream> spos,
86 bool readOnly =
false);
91 std::size_t leftMargin,
92 std::shared_ptr<MemOstream> spos,
93 bool readOnly =
false);
98 std::shared_ptr<std::vector<char> > spvc,
99 bool readOnly =
false);
104 std::size_t leftMargin,
105 std::shared_ptr<std::vector<char> > spvc,
106 bool readOnly =
false);
111 ReallocBufferPtr sprb,
112 bool readOnly =
false);
117 std::size_t leftMargin,
118 ReallocBufferPtr sprb,
119 bool readOnly =
false);
123 std::size_t offset = 0,
124 std::size_t len = std::size_t(-1));
126 char * getPtr()
const;
127 std::size_t getLength()
const;
128 std::size_t getLeftMargin()
const;
129 bool getReadOnly()
const;
130 bool isEmpty()
const;
131 std::string string()
const;
133 void setLeftMargin(std::size_t len);
134 void expandIntoLeftMargin(std::size_t len);
142 static const std::size_t npos;
146 std::shared_ptr< std::vector<char> > mSpvc;
147 std::shared_ptr< MemOstream > mSpos;
148 std::shared_ptr< ReallocBuffer > mSprb;
152 std::size_t mLeftMargin;
158 RCF_EXPORT std::size_t lengthByteBuffers(
159 const std::vector<ByteBuffer> &byteBuffers);
161 RCF_EXPORT
void forEachByteBuffer(
162 std::function<
void(
const ByteBuffer&)> functor,
163 const std::vector<ByteBuffer> &byteBuffers,
165 std::size_t length = -1);
168 const std::vector<ByteBuffer> &slicedBuffers,
170 std::size_t length = -1);
172 RCF_EXPORT
void sliceByteBuffers(
173 std::vector<ByteBuffer> &slicedBuffers,
174 const std::vector<ByteBuffer> &byteBuffers,
176 std::size_t length = std::size_t(-1));
178 RCF_EXPORT
void copyByteBuffers(
179 const std::vector<ByteBuffer> &byteBuffers,
182 RCF_EXPORT
void copyByteBuffers(
183 const std::vector<ByteBuffer> &byteBuffers,
196 #endif // ! INCLUDE_RCF_BYTEBUFFER_HPP Represents an archive, in which serialized objects are stored.
Definition: Archive.hpp:31
Definition: ByteBuffer.hpp:188
Definition: ByteBuffer.hpp:39
Definition: AmiIoHandler.hpp:23