Class MHO_VexTokenProcessor.
More...
#include <MHO_VexTokenProcessor.hh>
|
| MHO_VexTokenProcessor () |
|
virtual | ~MHO_VexTokenProcessor () |
|
bool | ContainsWhitespace (std::string value) |
| Checks if a given string contains whitespace characters. More...
|
|
mho_json | ProcessInt (const std::string &element_name, mho_json &format, std::vector< std::string > &tokens) |
| Converts first token to integer and returns as mho_json. More...
|
|
mho_json | ProcessListInt (const std::string &element_name, mho_json &format, std::vector< std::string > &tokens) |
| Converts a list of string tokens into integers and stores them in an mho_json object. More...
|
|
mho_json | ProcessListReal (const std::string &element_name, mho_json &format, std::vector< std::string > &tokens) |
| Processes a list of real numbers as strings and converts them into a JSON object with values and optional units. More...
|
|
mho_json | ProcessListString (const std::string &element_name, mho_json &format, std::vector< std::string > &tokens) |
| Processes a list string into a JSON object and stores tokens. More...
|
|
mho_json | ProcessReal (const std::string &element_name, mho_json &format, std::vector< std::string > &tokens) |
| Processes a real number value from tokens and returns it as an mho_json object. More...
|
|
Class MHO_VexTokenProcessor.
Converts vex tokens (strings) into values of a specific type.
- Author
- J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
- Date
- Mon Jun 13 22:27:21 2022 -0400
◆ MHO_VexTokenProcessor()
hops::MHO_VexTokenProcessor::MHO_VexTokenProcessor |
( |
| ) |
|
◆ ~MHO_VexTokenProcessor()
hops::MHO_VexTokenProcessor::~MHO_VexTokenProcessor |
( |
| ) |
|
|
virtual |
◆ ContainsWhitespace()
bool hops::MHO_VexTokenProcessor::ContainsWhitespace |
( |
std::string |
value | ) |
|
Checks if a given string contains whitespace characters.
- Parameters
-
value | Input string to be checked for whitespace. |
- Returns
- True if string contains whitespace, false otherwise.
◆ ProcessInt()
mho_json hops::MHO_VexTokenProcessor::ProcessInt |
( |
const std::string & |
element_name, |
|
|
mho_json & |
format, |
|
|
std::vector< std::string > & |
tokens |
|
) |
| |
Converts first token to integer and returns as mho_json.
- Parameters
-
element_name | Name of the element being processed |
format | Reference to the format object (not used in this function) |
tokens | Vector of strings containing tokens for processing |
- Returns
- First token converted to integer as mho_json
◆ ProcessListInt()
mho_json hops::MHO_VexTokenProcessor::ProcessListInt |
( |
const std::string & |
element_name, |
|
|
mho_json & |
format, |
|
|
std::vector< std::string > & |
tokens |
|
) |
| |
Converts a list of string tokens into integers and stores them in an mho_json object.
- Parameters
-
element_name | Name of the element being processed |
format | Reference to an mho_json object for formatting purposes (not used) |
tokens | Vector of strings containing integer values to be converted |
- Returns
- mho_json object containing the converted integers as a vector of ints
◆ ProcessListReal()
mho_json hops::MHO_VexTokenProcessor::ProcessListReal |
( |
const std::string & |
element_name, |
|
|
mho_json & |
format, |
|
|
std::vector< std::string > & |
tokens |
|
) |
| |
Processes a list of real numbers as strings and converts them into a JSON object with values and optional units.
- Parameters
-
element_name | The name of the element being processed. |
format | An mho_json reference used internally for formatting. |
tokens | A vector of string tokens representing numerical values or value-unit pairs. |
- Returns
- An mho_json object containing 'values' (a vector of doubles) and optionally 'units'.
◆ ProcessListString()
mho_json hops::MHO_VexTokenProcessor::ProcessListString |
( |
const std::string & |
element_name, |
|
|
mho_json & |
format, |
|
|
std::vector< std::string > & |
tokens |
|
) |
| |
Processes a list string into a JSON object and stores tokens.
- Parameters
-
element_name | The name of the element to process. |
format | Reference to an mho_json object for formatting. |
tokens | Reference to a vector of strings containing tokens. |
- Returns
- A JSON object containing the processed list string.
◆ ProcessReal()
mho_json hops::MHO_VexTokenProcessor::ProcessReal |
( |
const std::string & |
element_name, |
|
|
mho_json & |
format, |
|
|
std::vector< std::string > & |
tokens |
|
) |
| |
Processes a real number value from tokens and returns it as an mho_json object.
- Parameters
-
element_name | Name of the element being processed |
format | Reference to the format object for processing |
tokens | Vector of strings containing token values |
- Returns
- mho_json object containing 'value' and optionally 'units'
The documentation for this class was generated from the following files: