bes  Updated for version 3.20.6
MemoryStream Struct Reference

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

#include <memorystream.h>

Collaboration diagram for MemoryStream:
Collaboration graph

Public Types

typedef char Ch
 
typedef char Ch
 

Public Member Functions

void Flush ()
 
void Flush ()
 
 MemoryStream (const Ch *src, size_t size)
 
 MemoryStream (const Ch *src, size_t size)
 
Ch Peek () const
 
Ch Peek () const
 
const Ch * Peek4 () const
 
const Ch * Peek4 () const
 
void Put (Ch)
 
void Put (Ch)
 
Ch * PutBegin ()
 
Ch * PutBegin ()
 
size_t PutEnd (Ch *)
 
size_t PutEnd (Ch *)
 
Ch Take ()
 
Ch Take ()
 
size_t Tell () const
 
size_t Tell () const
 

Public Attributes

const Ch * begin_
 Original head of the string. More...
 
const Ch * end_
 End of stream. More...
 
size_t size_
 Size of the stream. More...
 
const Ch * src_
 Current read position. More...
 

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

Definition at line 40 of file cmr_module/rapidjson/memorystream.h.

Member Data Documentation

◆ begin_

const Ch * MemoryStream::begin_

Original head of the string.

Definition at line 60 of file cmr_module/rapidjson/memorystream.h.

◆ end_

const Ch * MemoryStream::end_

End of stream.

Definition at line 61 of file cmr_module/rapidjson/memorystream.h.

◆ size_

size_t MemoryStream::size_

Size of the stream.

Definition at line 62 of file cmr_module/rapidjson/memorystream.h.

◆ src_

const Ch * MemoryStream::src_

Current read position.

Definition at line 59 of file cmr_module/rapidjson/memorystream.h.


The documentation for this struct was generated from the following file: