27#ifndef _UCOMMON_NUMBERS_H_
28#define _UCOMMON_NUMBERS_H_
30#ifndef _UCOMMON_CONFIG_H_
71 inline const char *
c_str()
const {
93 inline operator long()
const {
101 inline operator char*()
const {
145 inline bool operator==(
const long value)
const {
146 return get() == value;
149 inline bool operator!=(
const long value)
const {
150 return get() != value;
153 inline bool operator<(
const long value)
const {
154 return get() < value;
157 inline bool operator>(
const long value)
const {
158 return get() > value;
161 inline bool operator<=(
const long value)
const {
162 return get() <= value;
165 inline bool operator>=(
const long value)
const {
166 return get() >= value;
217inline const T
abs(
const T& value)
232inline const T (
min)(
const T& v1,
const T& v2)
234 return ((v1 < v2) ? v1 : v2);
244inline const T (
max)(
const T& v1,
const T& v2)
246 return ((v1 > v2) ? v1 : v2);
Various miscellaneous platform specific headers and defines.
Common namespace for all ucommon objects.
T & max(T &o1, T &o2)
Convenience function to return max of two objects.
Number number_t
A convenience type for number.
T & min(T &o1, T &o2)
Convenience function to return min of two objects.
ZNumber znumber_t
A convenience type for znumber.
const T abs(const T &value)
Template for absolute value of a type.
Generic smart pointer class.
A number manipulation class.
long get() const
Get value of string buffer as a long integer.
const char * c_str() const
Get string buffer representing the number.
long operator--()
Decrement the number object.
void set(long value)
Set string based on a new value.
long operator=(long value)
Assign a value to the number.
long operator()() const
Get value of string buffer as expression of object.
Number(char *buffer, unsigned size)
Create an instance of a number.
long operator-=(const long value)
Subtract a value from the number.
long operator+=(const long value)
Add a value to the number.
long operator=(const Number &number)
Assign another number to this number.
long operator++()
Increment the number object.
A number manipulation class that maintains a zero lead filled string.
long operator=(long value)
Assign number from value.
ZNumber(char *pointer, unsigned size)
Create a number class for zero fill.
void set(long value)
Set value of zero filled number.