MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
MFM::CharBufferByteSource Class Reference

#include <CharBufferByteSource.h>

Inheritance diagram for MFM::CharBufferByteSource:
MFM::ByteSource MFM::ZStringByteSource

Public Member Functions

 CharBufferByteSource (const char *input, u32 length)
 
virtual int ReadByte ()
 
void ChangeBuffer (const char *newBuffer, u32 bufferLength)
 
void Reset ()
 
- Public Member Functions inherited from MFM::ByteSource
 ByteSource ()
 
s32 Read ()
 
void Unread ()
 
s32 Peek ()
 
virtual ~ByteSource ()
 
u32 GetBytesRead ()
 
bool Scan (u64 &result)
 
bool Scan (s32 &result, Format::Type code=Format::DEC, u32 fieldWidth=U32_MAX)
 
bool Scan (u32 &result, Format::Type code=Format::DEC, u32 fieldWidth=U32_MAX)
 
bool Scan (ByteSerializable &byteSerializable, s32 argument=0)
 
bool ScanLexDigits (u32 &digits)
 
bool Scan (ByteSink &result, const u32 fieldWidth)
 
s32 ScanSet (ByteSink &result, const char *setSpec)
 
s32 SkipSet (const char *setSpec)
 
s32 ScanSetFormat (ByteSink &result, const char *&setSpec)
 
bool ScanIdentifier (ByteSink &result)
 
bool ScanHex (ByteSink &result)
 
bool ScanBinary (ByteSink &result)
 
bool ScanCamelIdentifier (ByteSink &result)
 
s32 SkipWhitespace ()
 
s32 Scanf (const char *format,...)
 
s32 Vscanf (const char *format, va_list &ap)
 

Additional Inherited Members

- Static Public Attributes inherited from MFM::ByteSource
static const char * WHITESPACE_CHARS = " \n\t\v"
 
static const char * WHITESPACE_SET = "[ \n\t\v]"
 
static const char * NON_WHITESPACE_SET = "[^ \n\t\v]"
 

Detailed Description

A ByteSource backed by a char pointer.

Constructor & Destructor Documentation

MFM::CharBufferByteSource::CharBufferByteSource ( const char *  input,
u32  length 
)
inline

Constructs a new CharBufferByteSource backed by a provided char pointer. The length of readable bytes by the provided char pointer must also be provided.

Parameters
inputThe char* to back this CharBufferByteSource by. This must not be NULL, else this constructor will FAIL with NULL_POINTER .
lengthThe number of readable bytes which may be read from input .

Member Function Documentation

void MFM::CharBufferByteSource::ChangeBuffer ( const char *  newBuffer,
u32  bufferLength 
)
inline

Assigns a new char pointer to this CharBufferByteSource. Used to reconstruct this CharBufferByteSource as needed.

Parameters
newBufferThe new char pointer which this CharBufferByteSource will point to. This must not be NULL, else will FAIL with NULL_POINTER .
bufferLengthThe number of readable bytes which may be read from newBuffer .
virtual int MFM::CharBufferByteSource::ReadByte ( )
inlinevirtual

Reads the next byte from the front of this CharBufferByteSource and advances the pointer.

Returns
the next byte from the front of this CharBufferByteSource .

Implements MFM::ByteSource.

void MFM::CharBufferByteSource::Reset ( )
inline

Effectively clears this CharBufferByteSource, making all bytes since either construction or ChangeBuffer() available again from the beginning of the buffer.


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