VR-Vantage 3.0.3 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes
MemoryStream Struct Reference

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

Public Types

typedef char Ch

Public Member Functions

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

Public Attributes

const Chsrc_
 Current read position.
const Chbegin_
 Original head of the string.
const Chend_
 End of stream.
size_t size_
 Size of the stream.

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

Member Typedef Documentation

typedef char MemoryStream::Ch

Constructor & Destructor Documentation

MemoryStream::MemoryStream ( const Ch src,
size_t  size 
)
inline

Member Function Documentation

Ch MemoryStream::Peek ( ) const
inline

References end_, RAPIDJSON_UNLIKELY, and src_.

Ch MemoryStream::Take ( )
inline

References end_, RAPIDJSON_UNLIKELY, and src_.

size_t MemoryStream::Tell ( ) const
inline

References begin_, and src_.

Referenced by Peek4().

Ch* MemoryStream::PutBegin ( )
inline

References RAPIDJSON_ASSERT.

void MemoryStream::Put ( Ch  )
inline

References RAPIDJSON_ASSERT.

void MemoryStream::Flush ( )
inline

References RAPIDJSON_ASSERT.

size_t MemoryStream::PutEnd ( Ch )
inline

References RAPIDJSON_ASSERT.

const Ch* MemoryStream::Peek4 ( ) const
inline

References size_, src_, and Tell().

Member Data Documentation

const Ch* MemoryStream::src_

Current read position.

Referenced by Peek(), Peek4(), Take(), and Tell().

const Ch* MemoryStream::begin_

Original head of the string.

Referenced by Tell().

const Ch* MemoryStream::end_

End of stream.

Referenced by Peek(), and Take().

size_t MemoryStream::size_

Size of the stream.

Referenced by Peek4().


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


Copyright © 2005-2023 MAK Technologies. All Rights Reserved (www.mak.com)