Torque3D Documentation / _generateds / GenericMemoryBuffer

GenericMemoryBuffer

Engine/source/persistence/rapidjson/memorybuffer.h

Represents an in-memory output byte stream.

More...

Public Types

char
Ch 

Public Static Attributes

Public Attributes

Public Functions

GenericMemoryBuffer(Allocator * allocator, size_t capacity)
size_t
Pop(size_t count)
Ch *
Push(size_t count)
Put(Ch c)

Detailed Description

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.

Parameters:

Allocator

type for allocating memory buffer.

note:

implements Stream concept

Public Types

typedef char Ch 

Public Static Attributes

const size_t kDefaultCapacity 

Public Attributes

internal::Stack< Allocator > stack_ 

Public Functions

GenericMemoryBuffer(Allocator * allocator, size_t capacity)

Clear()

Flush()

GetBuffer()

GetSize()

Pop(size_t count)

Push(size_t count)

Put(Ch c)

ShrinkToFit()