Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/io/Output.h>
Public Member Functions | |
IntFormat (void) | |
IntFormat (signed char value) | |
IntFormat (unsigned char value) | |
IntFormat (signed short value) | |
IntFormat (unsigned short value) | |
IntFormat (signed int value) | |
IntFormat (unsigned int value) | |
IntFormat (signed long value) | |
IntFormat (unsigned long value) | |
IntFormat (signed long long value) | |
IntFormat (unsigned long long value) | |
IntFormat | operator() (t::int8 value) |
IntFormat | operator() (t::uint8 value) |
IntFormat | operator() (t::int16 value) |
IntFormat | operator() (t::uint16 value) |
IntFormat | operator() (t::int32 value) |
IntFormat | operator() (t::uint32 value) |
IntFormat | operator() (t::int64 value) |
IntFormat | operator() (t::uint64 value) |
IntFormat | base (int b) |
IntFormat | bin (void) |
IntFormat | oct (void) |
IntFormat | dec (void) |
IntFormat | hex (void) |
IntFormat | width (int w) |
IntFormat | align (alignment_t a) |
IntFormat | left (void) |
IntFormat | center (void) |
IntFormat | right (void) |
IntFormat | upper (void) |
IntFormat | lower (void) |
IntFormat | sign (void) |
IntFormat | pad (char p) |
Public Attributes | |
t::int64 | _val |
unsigned char | _base |
unsigned char | _width |
unsigned | _align: 5 |
unsigned | _upper: 1 |
unsigned | _sign: 1 |
unsigned | _displaySign: 1 |
char | _pad |
char | _size |
This class is used to perform formatting on integer passed to the Output class.
It is rarely used as-is but with some inlines functions performing formatting: io::base, io::bin, io::hex, op::width, io::align, io::left, io::center, io::right, io::pad, io::uppercase, io::lowercase.
elm::io::IntFormat::IntFormat | ( | void | ) |
elm::io::IntFormat::IntFormat | ( | signed char | value | ) |
elm::io::IntFormat::IntFormat | ( | unsigned char | value | ) |
elm::io::IntFormat::IntFormat | ( | signed short | value | ) |
elm::io::IntFormat::IntFormat | ( | unsigned short | value | ) |
elm::io::IntFormat::IntFormat | ( | signed int | value | ) |
elm::io::IntFormat::IntFormat | ( | unsigned int | value | ) |
elm::io::IntFormat::IntFormat | ( | signed long | value | ) |
elm::io::IntFormat::IntFormat | ( | unsigned long | value | ) |
elm::io::IntFormat::IntFormat | ( | signed long long | value | ) |
elm::io::IntFormat::IntFormat | ( | unsigned long long | value | ) |
IntFormat elm::io::IntFormat::align | ( | alignment_t | a | ) |
Set the alignment of the format.
a | Alignment (one of io::LEFT, io::CENTER or io::RIGHT). |
References _align.
Referenced by elm::io::align().
IntFormat elm::io::IntFormat::base | ( | int | b | ) |
Set the base.
b | Base of the format. |
References _base.
Referenced by elm::io::base().
IntFormat elm::io::IntFormat::bin | ( | void | ) |
IntFormat elm::io::IntFormat::center | ( | void | ) |
Set the format to centered alignment.
References _align, and elm::io::CENTER.
Referenced by elm::io::center().
IntFormat elm::io::IntFormat::dec | ( | void | ) |
IntFormat elm::io::IntFormat::hex | ( | void | ) |
Set the base to hexadecimal.
Referenced by elm::io::byte(), elm::io::hex(), and elm::io::pointer().
IntFormat elm::io::IntFormat::left | ( | void | ) |
Set the format to left alignment.
References _align, and elm::io::LEFT.
Referenced by elm::io::left().
IntFormat elm::io::IntFormat::lower | ( | void | ) |
Use lower case letters for base greater than 10.
References _upper.
Referenced by elm::io::lowercase().
IntFormat elm::io::IntFormat::oct | ( | void | ) |
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
Instantiate the format for the given integer.
value | Integer to format. |
References _val, elm::io::f(), and elm::value().
IntFormat elm::io::IntFormat::pad | ( | char | p | ) |
Set the padding character.
p | Padding characrer. |
References _pad.
Referenced by elm::io::byte(), elm::io::pad(), and elm::io::pointer().
IntFormat elm::io::IntFormat::right | ( | void | ) |
Set the format to right alignment.
References _align, and elm::io::RIGHT.
Referenced by elm::io::byte(), and elm::io::right().
IntFormat elm::io::IntFormat::sign | ( | void | ) |
Ever display the sign of the integer (even for positives).
References _displaySign.
Referenced by elm::io::sign().
IntFormat elm::io::IntFormat::upper | ( | void | ) |
Use upper case letters for base greater than 10.
References _upper.
Referenced by elm::io::uppercase().
IntFormat elm::io::IntFormat::width | ( | int | w | ) |
Set the width of the format.
w | Width in characters. |
References _width.
Referenced by elm::io::byte(), elm::io::pointer(), and elm::io::width().
unsigned elm::io::IntFormat::_align |
Alignment of integer in the field. One of LEFT, CENTER or RIGHT.
Referenced by align(), center(), left(), elm::io::Output::print(), and right().
IntFormat elm::io::IntFormat::_base |
char elm::io::IntFormat::_displaySign |
If true, the sign of signed value is always displayed. Else only the minus is displayed when needed.
Referenced by elm::io::Output::print(), and sign().
char elm::io::IntFormat::_pad |
Character used to pad the displayed integer in the field (default '0').
Referenced by pad(), and elm::io::Output::print().
unsigned elm::io::IntFormat::_sign |
If true, ever display the sign. If false (default), only display negative sign.
Referenced by bin(), hex(), oct(), and elm::io::Output::print().
char elm::io::IntFormat::_size |
Referenced by elm::io::Output::print().
unsigned elm::io::IntFormat::_upper |
If true, upper case characters will be used to display integer whose base is greater than 10. If false (default), lower case characters will be used.
Referenced by lower(), elm::io::Output::print(), and upper().
t::int64 elm::io::IntFormat::_val |
Referenced by operator()(), and elm::io::Output::print().
unsigned char elm::io::IntFormat::_width |
Width of the field where the integer will be displayed. Default 0 for no field width constraint. If the displayed integer size is less than the width, it will be aligned according the IntFormat::align attribute and padded according the IntFormat::pad attribute.
Referenced by elm::io::Output::print(), and width().