Unsigned integer.
More...
#include <base/UnsignedInteger.h>
Inherits Object.
|
enum | { FLAG_ALLOW_SPACES = 1 << 0
} |
|
enum | BaseFlags {
BIN = 1 << 0,
DEC = 1 << 2,
OCT = 1 << 3,
HEX = 1 << 4,
PREFIX = 1 << 5,
ANY =BIN|DEC|OCT|HEX|PREFIX,
FLAG_DEFAULT = FLAG_ALLOW_SPACES | ANY
} |
|
|
static unsigned int | parse (const char *src, const char *end, unsigned int flags=FLAG_DEFAULT) |
|
static unsigned int | parse (const String &string, unsigned int flags=FLAG_DEFAULT) |
|
static Validified< unsigned int > | parseNoThrow (const char *src, const char *end, unsigned int flags=FLAG_DEFAULT) noexcept |
|
static Validified< unsigned int > | parseNoThrow (const String &string, unsigned int flags=FLAG_DEFAULT) noexcept |
|
Unsigned integer.
Unsigned integer (32 bits or more).
- Version
- 1.0
- Examples
- testsuite/echod.cpp, testsuite/ftp.cpp, testsuite/http.cpp, and testsuite/ping.cpp.
◆ BaseFlags
Enumerator |
---|
BIN | Specifies binary integer base (2).
|
DEC | Specifies decimal integer base (10).
|
OCT | Specifies octal integer base (8).
|
HEX | Specifies hexadecimal integer base (16).
|
PREFIX | Specifies that prefix is required.
|
ANY | Specifies any supported base (integer base is derived from prefix).
|
◆ UnsignedInteger() [1/3]
UnsignedInteger::UnsignedInteger |
( |
| ) |
|
|
inlinenoexcept |
Initializes the integer as zero.
◆ UnsignedInteger() [2/3]
UnsignedInteger::UnsignedInteger |
( |
unsigned int |
value | ) |
|
|
inlinenoexcept |
Initializes the integer with the specified value. Implicit initialization allowed.
- Parameters
-
◆ UnsignedInteger() [3/3]
Copy constructor. Initializes a new Integer from other Integer object.
◆ getValue()
unsigned int UnsignedInteger::getValue |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator unsigned int()
UnsignedInteger::operator unsigned int |
( |
| ) |
const |
|
inlinenoexcept |
Casts integer to native type.
◆ operator=() [1/2]
Assignment of integer to this integer.
◆ operator=() [2/2]
Assignment of native type to this integer.
◆ parse() [1/2]
static unsigned int UnsignedInteger::parse |
( |
const char * |
src, |
|
|
const char * |
end, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
static |
Returns the value of the integer string representation.
- Parameters
-
src | The string representation. |
end | The string representation. |
accept | Specifies the integer bases to accept. Default is ANY. |
- Examples
- testsuite/IEEE1394.cpp.
◆ parse() [2/2]
static unsigned int UnsignedInteger::parse |
( |
const String & |
string, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
inlinestatic |
◆ parseNoThrow() [1/2]
static Validified<unsigned int> UnsignedInteger::parseNoThrow |
( |
const char * |
src, |
|
|
const char * |
end, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
staticnoexcept |
Returns the value of the integer string representation.
- Parameters
-
src | The string representation. |
end | The string representation. |
accept | Specifies the integer bases to accept. Default is FLAG_DEFAULT. |
◆ parseNoThrow() [2/2]
static Validified<unsigned int> UnsignedInteger::parseNoThrow |
( |
const String & |
string, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
inlinestaticnoexcept |
◆ setValue()
void UnsignedInteger::setValue |
( |
unsigned int |
value | ) |
|
|
inlinenoexcept |
Sets the value of the integer.
- Parameters
-
◆ MAXIMUM
const unsigned int UnsignedInteger::MAXIMUM = PrimitiveTraits<unsigned int>::MAXIMUM |
|
static |
Specifies the maximum value.
◆ MINIMUM
const unsigned int UnsignedInteger::MINIMUM = PrimitiveTraits<unsigned int>::MINIMUM |
|
static |
Specifies the minimum value.
◆ SIGNED
const bool UnsignedInteger::SIGNED = false |
|
static |
True if the integer type is signed.
◆ value
unsigned int UnsignedInteger::value = 0 |
|
protected |