NCBI C++ ToolKit
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
rapidjson::GenericMemoryBuffer< Allocator > Struct Template Reference

Search Toolkit Book for rapidjson::GenericMemoryBuffer

Represents an in-memory output byte stream. More...

#include <misc/jsonwrapp/rapidjson11/memorybuffer.h>

+ Collaboration diagram for rapidjson::GenericMemoryBuffer< Allocator >:

Public Types

typedef char Ch
 

Public Member Functions

 GenericMemoryBuffer (Allocator *allocator=0, size_t capacity=kDefaultCapacity)
 
void Put (Ch c)
 
void Flush ()
 
void Clear ()
 
void ShrinkToFit ()
 
ChPush (size_t count)
 
void Pop (size_t count)
 
const ChGetBuffer () const
 
size_t GetSize () const
 

Public Attributes

internal::Stack< Allocatorstack_
 

Static Public Attributes

static const size_t kDefaultCapacity = 256
 

Detailed Description

template<typename Allocator = CrtAllocator>
struct rapidjson::GenericMemoryBuffer< Allocator >

Represents an in-memory output byte stream.

This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.

It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.

Differences between MemoryBuffer and StringBuffer: 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.

Template Parameters
Allocatortype for allocating memory buffer.
Note
implements Stream concept

Definition at line 37 of file memorybuffer.h.

Member Typedef Documentation

◆ Ch

template<typename Allocator = CrtAllocator>
typedef char rapidjson::GenericMemoryBuffer< Allocator >::Ch

Definition at line 38 of file memorybuffer.h.

Constructor & Destructor Documentation

◆ GenericMemoryBuffer()

template<typename Allocator = CrtAllocator>
rapidjson::GenericMemoryBuffer< Allocator >::GenericMemoryBuffer ( Allocator allocator = 0,
size_t  capacity = kDefaultCapacity 
)
inline

Definition at line 40 of file memorybuffer.h.

Member Function Documentation

◆ Clear()

template<typename Allocator = CrtAllocator>
void rapidjson::GenericMemoryBuffer< Allocator >::Clear ( void  )
inline

Definition at line 45 of file memorybuffer.h.

◆ Flush()

template<typename Allocator = CrtAllocator>
void rapidjson::GenericMemoryBuffer< Allocator >::Flush ( void  )
inline

Definition at line 43 of file memorybuffer.h.

◆ GetBuffer()

template<typename Allocator = CrtAllocator>
const Ch* rapidjson::GenericMemoryBuffer< Allocator >::GetBuffer ( void  ) const
inline

Definition at line 50 of file memorybuffer.h.

◆ GetSize()

template<typename Allocator = CrtAllocator>
size_t rapidjson::GenericMemoryBuffer< Allocator >::GetSize ( void  ) const
inline

Definition at line 54 of file memorybuffer.h.

◆ Pop()

template<typename Allocator = CrtAllocator>
void rapidjson::GenericMemoryBuffer< Allocator >::Pop ( size_t  count)
inline

Definition at line 48 of file memorybuffer.h.

References count.

◆ Push()

template<typename Allocator = CrtAllocator>
Ch* rapidjson::GenericMemoryBuffer< Allocator >::Push ( size_t  count)
inline

Definition at line 47 of file memorybuffer.h.

References count.

◆ Put()

template<typename Allocator = CrtAllocator>
void rapidjson::GenericMemoryBuffer< Allocator >::Put ( Ch  c)
inline

Definition at line 42 of file memorybuffer.h.

◆ ShrinkToFit()

template<typename Allocator = CrtAllocator>
void rapidjson::GenericMemoryBuffer< Allocator >::ShrinkToFit ( )
inline

Definition at line 46 of file memorybuffer.h.

Member Data Documentation

◆ kDefaultCapacity

template<typename Allocator = CrtAllocator>
const size_t rapidjson::GenericMemoryBuffer< Allocator >::kDefaultCapacity = 256
static

Definition at line 56 of file memorybuffer.h.

◆ stack_

template<typename Allocator = CrtAllocator>
internal::Stack<Allocator> rapidjson::GenericMemoryBuffer< Allocator >::stack_
mutable

Definition at line 57 of file memorybuffer.h.

Referenced by rapidjson::PutN().


The documentation for this struct was generated from the following files:
Modified on Wed Sep 04 15:03:31 2024 by modify_doxy.py rev. 669887