BEEP-8 Helper Lib 1.0.0
Loading...
Searching...
No Matches
CTokenizer Class Reference

A tokenizer class for handling comma-separated equations. More...

#include <tokenizer.h>

Public Member Functions

str16 GetString (const char *lhs_, const char *def_="")
 Get the right-hand side string associated with a left-hand side key.
 
s32 GetNumber (const char *lhs_, s32 def_=0)
 Get the right-hand side number associated with a left-hand side key.
 
 CTokenizer (const char *sz, const MacroDict *dict_=nullptr)
 Constructor to initialize the tokenizer with a string of equations and an optional macro dictionary.
 

Detailed Description

A tokenizer class for handling comma-separated equations.

This class allows for handling multiple equations separated by a comma through its constructor CTokenizer::CTokenizer(). Right-hand side values of the equations can be obtained via CTokenizer::GetString() and CTokenizer::GetNumber().

For instance, if a string like "x=test,y=345,z=something" is passed into the constructor, the values can be retrieved as follows:

Constructor & Destructor Documentation

◆ CTokenizer()

CTokenizer::CTokenizer ( const char * sz,
const MacroDict * dict_ = nullptr )

Constructor to initialize the tokenizer with a string of equations and an optional macro dictionary.

Parameters
szThe string containing comma-separated equations.
dict_The optional macro dictionary.

Member Function Documentation

◆ GetNumber()

s32 CTokenizer::GetNumber ( const char * lhs_,
s32 def_ = 0 )

Get the right-hand side number associated with a left-hand side key.

Parameters
lhs_The left-hand side key.
def_The default value if the key is not found.
Returns
The right-hand side number.

◆ GetString()

str16 CTokenizer::GetString ( const char * lhs_,
const char * def_ = "" )

Get the right-hand side string associated with a left-hand side key.

Parameters
lhs_The left-hand side key.
def_The default value if the key is not found.
Returns
The right-hand side string.

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