Qore Programming Language Reference Manual 1.18.0
Loading...
Searching...
No Matches
Pseudo_QC_Int.dox.h
1
3namespace Qore {
5/***/
6class <int> : public <value> {
7
8public:
10
24int abs();
25
26public:
28
45
46public:
48
65
66public:
68
94string format(string fmt);
95
96public:
98
122string format(int prec = 2, string decimal_sep = ".", string thousands_sep = "");
123
124public:
126
137bool intp();
138
139public:
141
153int sign();
154
155public:
157
168bool strp();
169
170public:
172
207string toBase(int base = 10);
208
209public:
211
225string toUnicode();
226
227public:
229
244
245public:
247
261bool val();
262};
263}
Methods in this pseudo-class can be executed on integer values.
Definition: Pseudo_QC_Int.dox.h:6
string toBase(int base=10)
Converts the integer to a different base (and returns it as a string).
int abs()
Returns the absolute value of the number.
int typeCode()
Returns Qore::NT_INT.
bool intp()
Returns True by default.
string format(string fmt)
Returns a formatted string of the integer according to the format argument.
string format(int prec=2, string decimal_sep=".", string thousands_sep="")
Returns a formatted string of the integer according to format arguments.
binary encodeMsb(int size=4)
returns a binary object with the integer encoded in the given number of bytes in most significant byt...
binary encodeLsb(int size=4)
returns a binary object with the integer encoded in the given number of bytes in least significant by...
int sign()
Returns -1 if the number is negative, 0 if it is zero, or 1 if it is positive.
bool strp()
Returns True because integer values can be converted to strings.
string toUnicode()
Returns a single character string in UTF-8 encoding for the integer value treated as a unicode value.
bool val()
Returns True if the int is non-zero, False if zero.
Methods in this pseudo-class are available to be executed on any value type (even NOTHING); this is t...
Definition: Pseudo_QC_All.dox.h:6
int size()
Returns zero; this method will be reimplemented in container types where it may return a non-zero val...
binary binary()
Always returns an empty binary object (of zero length)
Qore namespace.
Definition: QC_AbstractSmartLock.dox.h:2