15 #ifndef CEREAL_RAPIDJSON_MEMORYBUFFER_H_
16 #define CEREAL_RAPIDJSON_MEMORYBUFFER_H_
36 template <
typename Allocator = CrtAllocator>
48 void Pop(
size_t count) {
stack_.template Pop<Ch>(count); }
51 return stack_.template Bottom<Ch>();
65 std::memset(memoryBuffer.
stack_.Push<
char>(n), c, n *
sizeof(c));
A type-unsafe stack for storing different types of data.
Definition: stack.h:37
Concept for allocating, resizing and freeing memory block.
#define CEREAL_RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:121
#define CEREAL_RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:124
void PutN(MemoryBuffer &memoryBuffer, char c, size_t n)
Implement specialized version of PutN() with memset() for better performance.
Definition: memorybuffer.h:64
GenericMemoryBuffer MemoryBuffer
Definition: memorybuffer.h:60
Represents an in-memory output byte stream.
Definition: memorybuffer.h:37
void Clear()
Definition: memorybuffer.h:45
char Ch
Definition: memorybuffer.h:38
void ShrinkToFit()
Definition: memorybuffer.h:46
Ch * Push(size_t count)
Definition: memorybuffer.h:47
void Pop(size_t count)
Definition: memorybuffer.h:48
const Ch * GetBuffer() const
Definition: memorybuffer.h:50
internal::Stack< Allocator > stack_
Definition: memorybuffer.h:57
void Flush()
Definition: memorybuffer.h:43
void Put(Ch c)
Definition: memorybuffer.h:42
size_t GetSize() const
Definition: memorybuffer.h:54
GenericMemoryBuffer(Allocator *allocator=0, size_t capacity=kDefaultCapacity)
Definition: memorybuffer.h:40
static const size_t kDefaultCapacity
Definition: memorybuffer.h:56