|
| void | assertTrue (bool bCond) |
| | Non ODR breaking assert. More...
|
| |
| template<typename T > |
| T | strToNumber (ParserCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrName, const std::string &sNr, bool bAllowPerc, bool bMin, T oMin, bool bMax, T oMax) |
| | Convert a string to a number. More...
|
| |
| template<typename T > |
| T | strToRangeNumber (ParserCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrName, const std::string &sNr, T oMin, T oMax) |
| | Convert a string to a number in a range. More...
|
| |
| bool | strToBool (ParserCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrName, const std::string &sTF) |
| | Converts a string to a boolean value. More...
|
| |
| uint32_t | strToUint32 (ParserCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrName, const std::string &sUint, bool bMin, uint32_t nMin, bool bMax, uint32_t nMax) |
| | Converts a string to an unsigned integer. More...
|
| |
| TileChar | strToTileChar (ParserCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrName, const std::string &sChar) |
| |
| TileColor | strToTileColor (ParserCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrName, const std::string &sColor) |
| | Convert string to tile color. More...
|
| |
| RgbColor | strHexToRGB (ParserCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttrName, const std::string &sHexNr) |
| |
| template<class TokenHandler > |
| void | tokenizer (const std::string &sStr, const std::string &sSeparator, TokenHandler oTokenHandler) |
| | Separates a string into tokens and passes them to a handler. More...
|
| |
| bool stmg::XmlUtil::strToBool |
( |
ParserCtx & |
oCtx, |
|
|
const xmlpp::Element * |
p0Element, |
|
|
const std::string & |
sAttrName, |
|
|
const std::string & |
sTF |
|
) |
| |
Converts a string to a boolean value.
The string can be "t", "T", "true", "True", "TRUE", "y", "Y", "yes", "Yes", "YES" or "f", "F", "false", "False", "FALSE", "n", "N", "no", "No", "NO".
- Parameters
-
| oCtx | The parser context. |
| p0Element | The element of the attribute. Cannot be null. |
| sAttrName | The attribute name. Cannot be empty. |
| sTF | The string value. |
- Returns
- The result value.
- Exceptions
-
| uint32_t stmg::XmlUtil::strToUint32 |
( |
ParserCtx & |
oCtx, |
|
|
const xmlpp::Element * |
p0Element, |
|
|
const std::string & |
sAttrName, |
|
|
const std::string & |
sUint, |
|
|
bool |
bMin, |
|
|
uint32_t |
nMin, |
|
|
bool |
bMax, |
|
|
uint32_t |
nMax |
|
) |
| |
Converts a string to an unsigned integer.
The string can contain the hexadecimal representation, in which case the string must have leading characters "0x". No whitespace is allowed.
Examples: valid strings "42", "0xA6C". Invalid strings: " 0xA6C", "0x A6C"
- Parameters
-
| oCtx | The parser context. |
| p0Element | The element of the attribute. Cannot be null. |
| sAttrName | The attribute name. Cannot be empty. |
| sUint | The string value. |
| bMin | Whether the result must be bigger or equal nMin. |
| nMin | The minimum value. Only used if bMin is true. |
| bMax | Whether the result must be smaller or equal nMax. |
| nMax | The maximum value. Only used if bMax is true. |
- Returns
- The result value.
- Exceptions
-
| If | number incorrect or not in the specified range. |