Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
|
#include <TokenStream.h>
Public Member Functions | |
TokenStream () | |
~TokenStream () | |
void | ResetStream () |
void | SetTokenStream (const char *data) |
bool | GetNextToken (std::string *buffer) |
bool | GetNextToken (std::string *token, std::string *buffer) |
bool | MoveToNextLine (std::string *buffer) |
Class to parse and extract tokens from a string, where a token is a word/group of non-whitespace characters, or a group of characters surrounded by quotes (e.g. "my token here").
Ult::TokenStream::TokenStream | ( | ) |
TokenStream constructor.
Ult::TokenStream::~TokenStream | ( | ) |
TokenStream destructor.
bool Ult::TokenStream::GetNextToken | ( | std::string * | buffer | ) |
Attempt to parse the next string token into buffer.
buffer | Optional string to store the token into. |
bool Ult::TokenStream::GetNextToken | ( | std::string * | token, |
std::string * | buffer ) |
Attempt to find the next instance of token and get the next token after that.
buffer | Optional string to store the token into. |
bool Ult::TokenStream::MoveToNextLine | ( | std::string * | buffer | ) |
Read into buffer until a valid non-whitespace character is found.
buffer | Optional string to store the parsed characters into. |
void Ult::TokenStream::ResetStream | ( | ) |
Move parsing back to the beginning of the string.
void Ult::TokenStream::SetTokenStream | ( | const char * | data | ) |
Calls ResetStream and sets the string data to parse. Data is copied into a buffer internally.