Parser for positive integers, either decimal or hexadecimal.
More...
#include "donner/base/parser/IntegerParser.h"
|
| struct | Result |
| | Container for parse result, containing the parsed result and the number of characters that were consumed to parse it. More...
|
Parser for positive integers, either decimal or hexadecimal.
◆ donner::parser::IntegerParser::Result
| struct donner::parser::IntegerParser::Result |
Container for parse result, containing the parsed result and the number of characters that were consumed to parse it.
| Class Members |
|
size_t |
consumedChars = 0 |
The number of characters of the input string that were consumed to parse the number. |
|
uint32_t |
number = 0 |
The parsed result. |
◆ Parse()
Parse a positive integer in decimal format.
- Parameters
-
| str | String to parse, not all characters may be consumed. |
| options | Parser options. |
- Returns
- Result containing the number and the number of characters that were parsed.
◆ ParseHex()
Parse a positive integer in hexadecimal format, e.g.
'FFEE'. The input string should not start with a prefix (no '0x').
- Parameters
-
| str | String to parse, not all characters may be consumed. |
| options | Parser options. |
- Returns
- Result containing the number and the number of characters that were parsed.
The documentation for this class was generated from the following files: