| 30 | #endif |
| 31 | |
| 32 | RAPIDJSON_NAMESPACE_BEGIN |
| 33 | |
| 34 | //! Represents an in-memory output stream. |
| 35 | /*! |
| 36 | \tparam Encoding Encoding of the stream. |
| 37 | \tparam Allocator type for allocating memory buffer. |
| 38 | \note implements Stream concept |
| 39 | */ |
| 40 | template <typename Encoding, typename Allocator = CrtAllocator> |
| 41 | class GenericStringBuffer { |
| 42 | public: |
| 43 | typedef typename Encoding::Ch Ch; |
| 44 | |
| 45 | GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} |
| 46 | |
| 47 | #if RAPIDJSON_HAS_CXX11_RVALUE_REFS |
| 48 | GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} |
| 49 | GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { |
| 50 | if (&rhs != this) |
| 51 | stack_ = std::move(rhs.stack_); |
| 52 | return *this; |
| 53 | } |
| 54 | #endif |
| 55 | |
| 56 | void Put(Ch c) { *stack_.template Push<Ch>() = c; } |
| 57 | void PutUnsafe(Ch c) { *stack_.template PushUnsafe<Ch>() = c; } |
| 58 | void Flush() {} |
| 59 | |
| 60 | void Clear() { stack_.Clear(); } |
nothing calls this directly
no outgoing calls
no test coverage detected