Signed integer.
More...
#include <base/Integer.h>
Inherits Object.
|
enum | { FLAG_ALLOW_SPACES = 1 << 0,
FLAG_ALLOW_SIGN = 1 << 1,
FLAG_DEFAULT = FLAG_ALLOW_SPACES | FLAG_ALLOW_SIGN
} |
|
|
static int | parse (const char *src, const char *end, unsigned int flags=FLAG_DEFAULT) |
|
static int | parse (const String &string, unsigned int flags=FLAG_DEFAULT) |
|
static int | parse (const wchar *src, const wchar *end, unsigned int flags=FLAG_DEFAULT) |
|
static int | parse (const ucs4 *src, const ucs4 *end, unsigned int flags=FLAG_DEFAULT) |
|
static int | parse (const WideString &string, unsigned int flags=FLAG_DEFAULT) |
|
Signed integer.
Signed integer (32 bits or more).
- Version
- 1.2
- Examples
- testsuite/server.cpp.
◆ Integer() [1/3]
Initializes the integer as zero.
◆ Integer() [2/3]
Integer::Integer |
( |
int |
value | ) |
|
|
inlinenoexcept |
Initializes the integer with the specified value. Implicit initialization allowed.
- Parameters
-
◆ Integer() [3/3]
Integer::Integer |
( |
const Integer & |
copy | ) |
|
|
inlinenoexcept |
Copy constructor. Initializes a new Integer from other Integer object.
◆ getValue()
int Integer::getValue |
( |
| ) |
const |
|
inlinenoexcept |
Gets the value of the integer.
◆ operator int()
Integer::operator int |
( |
| ) |
const |
|
inlinenoexcept |
Casts integer to native type.
◆ operator=() [1/2]
Assignment of integer to this integer.
◆ operator=() [2/2]
Integer& Integer::operator= |
( |
int |
value | ) |
|
|
inlinenoexcept |
Assignment of native type to this integer.
◆ parse() [1/5]
static int Integer::parse |
( |
const char * |
src, |
|
|
const char * |
end, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
static |
Returns the value of the integer string representation.
- Parameters
-
string | The string representation. |
flags | The parsing flags. |
◆ parse() [2/5]
static int Integer::parse |
( |
const String & |
string, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
inlinestatic |
Returns the value of the integer string representation.
- Parameters
-
string | The string representation. |
withoutSign | Effectively prevents signs from being parsed. Default is to allow a single sign. |
◆ parse() [3/5]
static int Integer::parse |
( |
const ucs4 * |
src, |
|
|
const ucs4 * |
end, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
static |
Returns the value of the integer string representation.
- Parameters
-
string | The string representation. |
flags | The parsing flags. |
◆ parse() [4/5]
static int Integer::parse |
( |
const wchar * |
src, |
|
|
const wchar * |
end, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
static |
Returns the value of the integer string representation.
- Parameters
-
string | The string representation. |
flags | The parsing flags. |
◆ parse() [5/5]
static int Integer::parse |
( |
const WideString & |
string, |
|
|
unsigned int |
flags = FLAG_DEFAULT |
|
) |
| |
|
inlinestatic |
Returns the value of the integer string representation.
- Parameters
-
string | The string representation. |
withoutSign | Effectively prevents signs from being parsed. Default is to allow a single sign. |
◆ setValue()
void Integer::setValue |
( |
int |
value | ) |
|
|
inlinenoexcept |
Sets the value of the integer.
- Parameters
-
◆ MAXIMUM
Specifies the maximum value.
◆ MINIMUM
Specifies the minimum value.
◆ SIGNED
const bool Integer::SIGNED = true |
|
static |
True if the integer type is signed.
◆ value