19 #ifndef INCLUDE_RCF_BYTEBUFFER_HPP 20 #define INCLUDE_RCF_BYTEBUFFER_HPP 27 #include <RCF/Export.hpp> 32 typedef std::shared_ptr<MemOstream> MemOstreamPtr;
35 typedef std::shared_ptr<ReallocBuffer> ReallocBufferPtr;
51 const std::vector<char> & vc);
55 const std::string & s);
59 std::shared_ptr<std::vector<char> > spvc,
60 bool readOnly =
false);
64 ReallocBufferPtr sprb,
65 bool readOnly =
false);
70 bool readOnly =
false);
75 bool readOnly =
false);
80 std::size_t leftMargin,
81 bool readOnly =
false);
86 std::shared_ptr<MemOstream> spos,
87 bool readOnly =
false);
92 std::size_t leftMargin,
93 std::shared_ptr<MemOstream> spos,
94 bool readOnly =
false);
99 std::shared_ptr<std::vector<char> > spvc,
100 bool readOnly =
false);
105 std::size_t leftMargin,
106 std::shared_ptr<std::vector<char> > spvc,
107 bool readOnly =
false);
112 ReallocBufferPtr sprb,
113 bool readOnly =
false);
118 std::size_t leftMargin,
119 ReallocBufferPtr sprb,
120 bool readOnly =
false);
124 std::size_t offset = 0,
125 std::size_t len = std::size_t(-1));
127 char * getPtr()
const;
128 std::size_t getLength()
const;
129 std::size_t getLeftMargin()
const;
130 bool getReadOnly()
const;
131 bool isEmpty()
const;
132 std::string string()
const;
134 void setLeftMargin(std::size_t len);
135 void expandIntoLeftMargin(std::size_t len);
143 static const std::size_t npos;
147 std::shared_ptr< std::vector<char> > mSpvc;
148 std::shared_ptr< MemOstream > mSpos;
149 std::shared_ptr< ReallocBuffer > mSprb;
153 std::size_t mLeftMargin;
159 RCF_EXPORT std::size_t lengthByteBuffers(
160 const std::vector<ByteBuffer> &byteBuffers);
162 RCF_EXPORT
void forEachByteBuffer(
163 std::function<
void(
const ByteBuffer&)> functor,
164 const std::vector<ByteBuffer> &byteBuffers,
166 std::size_t length = -1);
169 const std::vector<ByteBuffer> &slicedBuffers,
171 std::size_t length = -1);
173 RCF_EXPORT
void sliceByteBuffers(
174 std::vector<ByteBuffer> &slicedBuffers,
175 const std::vector<ByteBuffer> &byteBuffers,
177 std::size_t length = std::size_t(-1));
179 RCF_EXPORT
void copyByteBuffers(
180 const std::vector<ByteBuffer> &byteBuffers,
183 RCF_EXPORT
void copyByteBuffers(
184 const std::vector<ByteBuffer> &byteBuffers,
197 #endif // ! INCLUDE_RCF_BYTEBUFFER_HPP Represents an archive, in which serialized objects are stored.
Definition: Archive.hpp:32
Definition: ByteBuffer.hpp:189
Definition: ByteBuffer.hpp:40
Definition: AmiIoHandler.hpp:24