![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/io/Output.h>
Public Member Functions | |
IntFormat () | |
IntFormat (t::int8 value) | |
IntFormat (t::uint8 value) | |
IntFormat (t::int16 value) | |
IntFormat (t::uint16 value) | |
IntFormat (t::int32 value) | |
IntFormat (t::uint32 value) | |
IntFormat (t::int64 value) | |
IntFormat (t::uint64 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.
|
inline |
|
inline |
Set the alignment of the format.
a | Alignment (one of io::LEFT, io::CENTER or io::RIGHT). |
References IntFormat::_align.
Referenced by elm::io::align().
|
inline |
Set the base.
b | Base of the format. |
References IntFormat::_base.
Referenced by elm::io::base().
Set the base to binary.
References IntFormat::_base, and IntFormat::_sign.
Referenced by elm::io::bin().
Set the format to centered alignment.
References IntFormat::_align, and elm::io::CENTER.
Referenced by elm::io::center().
Set the base to hexadecimal.
References IntFormat::_base, and IntFormat::_sign.
Referenced by elm::io::byte(), elm::io::hex(), and elm::io::pointer().
Set the format to left alignment.
References IntFormat::_align, and elm::io::LEFT.
Referenced by elm::io::left().
Use lower case letters for base greater than 10.
References IntFormat::_upper.
Referenced by elm::io::lowercase().
Set the base to octal.
References IntFormat::_base, and IntFormat::_sign.
Referenced by elm::io::oct().
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
Instantiate the format for the given integer.
value | Integer to format. |
References IntFormat::_val.
|
inline |
Set the padding character.
p | Padding characrer. |
References IntFormat::_pad, and elm::io::p().
Referenced by elm::io::byte(), elm::io::pad(), and elm::io::pointer().
Set the format to right alignment.
References IntFormat::_align, and elm::io::RIGHT.
Referenced by elm::io::byte(), and elm::io::right().
Ever display the sign of the integer (even for positives).
References IntFormat::_displaySign.
Referenced by elm::io::sign().
Use upper case letters for base greater than 10.
References IntFormat::_upper.
Referenced by elm::io::uppercase().
|
inline |
Set the width of the format.
w | Width in characters. |
References IntFormat::_width.
Referenced by elm::io::byte(), elm::io::pointer(), and elm::io::width().
unsigned _align |
Alignment of integer in the field. One of LEFT, CENTER or RIGHT.
Referenced by IntFormat::align(), IntFormat::center(), IntFormat::left(), Output::print(), and IntFormat::right().
IntFormat _base |
Numeric base used to display the integer (default to 10).
Referenced by IntFormat::base(), IntFormat::bin(), IntFormat::dec(), IntFormat::hex(), IntFormat::oct(), and Output::print().
char _displaySign |
If true, the sign of signed value is always displayed. Else only the minus is displayed when needed.
Referenced by Output::print(), and IntFormat::sign().
char _pad |
Character used to pad the displayed integer in the field (default '0').
Referenced by IntFormat::pad(), and Output::print().
unsigned _sign |
If true, ever display the sign. If false (default), only display negative sign.
Referenced by IntFormat::bin(), IntFormat::hex(), IntFormat::oct(), and Output::print().
char _size |
Referenced by Output::print().
unsigned _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 IntFormat::lower(), Output::print(), and IntFormat::upper().
t::int64 _val |
Referenced by IntFormat::operator()(), and Output::print().
unsigned char _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 Output::print(), and IntFormat::width().