15 #ifndef RAPIDJSON_MEMORYBUFFER_H_
16 #define RAPIDJSON_MEMORYBUFFER_H_
36 template <
typename Allocator = CrtAllocator>
42 void Put(
Ch c) { *stack_.template Push<Ch>() = c; }
45 void Clear() { stack_.Clear(); }
51 return stack_.template Bottom<Ch>();
54 size_t GetSize()
const {
return stack_.GetSize(); }
56 static const size_t kDefaultCapacity = 256;
65 std::memset(memoryBuffer.
stack_.Push<
char>(
n), c,
n *
sizeof(c));
Concept for allocating, resizing and freeing memory block.
A type-unsafe stack for storing different types of data.
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
void PutN(MemoryBuffer &memoryBuffer, char c, size_t n)
Implement specialized version of PutN() with memset() for better performance.
GenericMemoryBuffer< CrtAllocator > MemoryBuffer
Represents an in-memory output byte stream.
const Ch * GetBuffer() const
GenericMemoryBuffer(Allocator *allocator=0, size_t capacity=kDefaultCapacity)
internal::Stack< Allocator > stack_