HDK
|
Go to the source code of this file.
Enumerations | |
enum | SYS_ParseStatus { SYS_ParseStatus::Success, SYS_ParseStatus::NoNumberFound, SYS_ParseStatus::InvalidArgs, SYS_ParseStatus::Overflow } |
List of possible states the parsing ended in. More... | |
enum | SYS_ParseFlags { SYS_ParseFlags::None = 0x00, SYS_ParseFlags::DigitSeparator = 0x01 } |
|
strong |
Enumerator | |
---|---|
None |
Default use. |
DigitSeparator |
Allow underscore ('_') to be used as a digit separator. |
Definition at line 30 of file SYS_ParseNumber.h.
|
strong |
List of possible states the parsing ended in.
Definition at line 20 of file SYS_ParseNumber.h.
SYS_API SYS_ParseStatus SYSparseFloat | ( | const char * | begin, |
const char *& | end, | ||
fpreal16 & | number, | ||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a delimited string into a float of a certain bit size. If end
is nullptr, then the string will be parsed until end. Upon return, end
will point to the character after the last one parsed.
SYS_API SYS_ParseStatus SYSparseFloat | ( | const char * | begin, |
const char *& | end, | ||
fpreal32 & | number, | ||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a delimited string into a float of a certain bit size. If end
is nullptr, then the string will be parsed until end. Upon return, end
will point to the character after the last one parsed.
SYS_API SYS_ParseStatus SYSparseFloat | ( | const char * | begin, |
const char *& | end, | ||
fpreal64 & | number, | ||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a delimited string into a float of a certain bit size. If end
is nullptr, then the string will be parsed until end. Upon return, end
will point to the character after the last one parsed.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
int8 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
uint8 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
int16 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
uint16 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
int32 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
uint32 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
int64 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.
SYS_API SYS_ParseStatus SYSparseInteger | ( | const char * | begin, |
const char *& | end, | ||
uint64 & | number, | ||
int | base = 0 , |
||
SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
) |
Parse a string, delimited by begin
and end
, into an integer of a certain bit size. Unlike strtod
and family, end
should always be a valid pointer to the character one past the last character to be parsed, or nullptr
. If end
is nullptr, then the string will be parsed until the end of the string, which, in that case, should be zero-terminated. Upon return, end
will point to the next character after the last one parsed. By default the number base is automatically determined by the number prefix (if any), although a specific base can be given to override this automatic choice. The range of supported bases is from 2 to 36, inclusive. A value of zero can be given for the function to automatically determine the base, from the prefix. In the absence of prefix the number is assumed to be decimal. Invalid base
values will cause the function to return immediately with SYS_ParseStatus::InvalidArgs
.