MemoryStream

Engine/source/persistence/rapidjson/memorystream.h

Represents an in-memory input byte stream.

More...

Public Types

char
Ch 

Public Attributes

Original head of the string.

End of stream.

size_t

Size of the stream.

Current read position.

Public Functions

MemoryStream(const Ch * src, size_t size)
Peek()
size_t
PutEnd(Ch * )
Take()
size_t
Tell()

Detailed Description

Represents an in-memory input byte stream.

This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream.

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

Differences between MemoryStream and StringStream:

  1. StringStream has encoding but MemoryStream is a byte stream.

  2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source.

  3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4().

    note:

    implements Stream concept

Public Types

typedef char Ch 

Public Attributes

const Ch * begin_ 

Original head of the string.

const Ch * end_ 

End of stream.

size_t size_ 

Size of the stream.

const Ch * src_ 

Current read position.

Public Functions

MemoryStream(const Ch * src, size_t size)

Flush()

Peek()

Peek4()

Put(Ch )

PutBegin()

PutEnd(Ch * )

Take()

Tell()