StreamToken Class Reference

#include <StreamCommandParser.h>

Public Member Functions

 StreamToken (const char *data)
 
bool nextToken ()
 
void previousToken ()
 
void skipBlanks ()
 
bool equals (const char *token)
 
bool atEnd ()
 
bool toNumber (int64_t &num)
 
bool toNumber (int &num)
 
size_t getLength ()
 

Protected Attributes

const char * sourceData
 
const char * string
 
size_t length
 
size_t offset
 

Detailed Description

Definition at line 76 of file StreamCommandParser.h.

Constructor & Destructor Documentation

◆ StreamToken()

StreamToken::StreamToken ( const char *  data)
inline

Definition at line 79 of file StreamCommandParser.h.

References length, offset, and sourceData.

Member Function Documentation

◆ atEnd()

bool StreamToken::atEnd ( void  )
inline

Definition at line 103 of file StreamCommandParser.h.

References offset, and sourceData.

◆ equals()

bool StreamToken::equals ( const char *  token)
inline

Definition at line 98 of file StreamCommandParser.h.

References length, and Utilities::memicmp().

Referenced by parser().

◆ getLength()

size_t StreamToken::getLength ( )
inline

Definition at line 146 of file StreamCommandParser.h.

References length.

Referenced by parser().

◆ nextToken()

bool StreamToken::nextToken ( )

Get the next token from the parsed string.

Returns
True if a token is available, false if we've hit the end.

Definition at line 56 of file StreamCommandParser.cpp.

References length, offset, skipBlanks(), and sourceData.

Referenced by parser(), position_offset(), and reclength_token().

◆ previousToken()

void StreamToken::previousToken ( )

Push a token back on to the stream.

Definition at line 105 of file StreamCommandParser.cpp.

References length.

Referenced by parser(), and reclength_token().

◆ skipBlanks()

void StreamToken::skipBlanks ( )
inline

Definition at line 89 of file StreamCommandParser.h.

References offset, and sourceData.

Referenced by nextToken().

◆ toNumber() [1/2]

bool StreamToken::toNumber ( int &  num)
inline

Definition at line 126 of file StreamCommandParser.h.

References length.

◆ toNumber() [2/2]

bool StreamToken::toNumber ( int64_t num)
inline

Definition at line 105 of file StreamCommandParser.h.

References length.

Referenced by position_offset(), and reclength_token().

Member Data Documentation

◆ length

size_t StreamToken::length
protected

◆ offset

size_t StreamToken::offset
protected

Definition at line 153 of file StreamCommandParser.h.

Referenced by atEnd(), nextToken(), skipBlanks(), and StreamToken().

◆ sourceData

const char* StreamToken::sourceData
protected

Definition at line 150 of file StreamCommandParser.h.

Referenced by atEnd(), nextToken(), skipBlanks(), and StreamToken().

◆ string

const char* StreamToken::string
protected

Definition at line 151 of file StreamCommandParser.h.


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