|
BEEP-8 Helper Lib 1.0.0
|
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. | |
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:
| CTokenizer::CTokenizer | ( | const char * | sz, |
| const MacroDict * | dict_ = nullptr ) |
Constructor to initialize the tokenizer with a string of equations and an optional macro dictionary.
| sz | The string containing comma-separated equations. |
| dict_ | The optional macro dictionary. |
| s32 CTokenizer::GetNumber | ( | const char * | lhs_, |
| s32 | def_ = 0 ) |
Get the right-hand side number associated with a left-hand side key.
| lhs_ | The left-hand side key. |
| def_ | The default value if the key is not found. |
| str16 CTokenizer::GetString | ( | const char * | lhs_, |
| const char * | def_ = "" ) |
Get the right-hand side string associated with a left-hand side key.
| lhs_ | The left-hand side key. |
| def_ | The default value if the key is not found. |