Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::io::IntFormat Class Reference

#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
 

Detailed Description

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.

Constructor & Destructor Documentation

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)

Member Function Documentation

IntFormat elm::io::IntFormat::align ( alignment_t  a)

Set the alignment of the format.

Parameters
aAlignment (one of io::LEFT, io::CENTER or io::RIGHT).
Returns
Built format.

References _align.

Referenced by elm::io::align().

IntFormat elm::io::IntFormat::base ( int  b)

Set the base.

Parameters
bBase of the format.
Returns
Built format.

References _base.

Referenced by elm::io::base().

IntFormat elm::io::IntFormat::bin ( void  )

Set the base to binary.

Returns
Built format.

References _base, and _sign.

Referenced by elm::io::bin().

IntFormat elm::io::IntFormat::center ( void  )

Set the format to centered alignment.

Returns
Built format.

References _align, and elm::io::CENTER.

Referenced by elm::io::center().

IntFormat elm::io::IntFormat::dec ( void  )

Set the base to decimal.

Returns
Built format.

References _base.

IntFormat elm::io::IntFormat::hex ( void  )

Set the base to hexadecimal.

Returns
Built format.

References _base, and _sign.

Referenced by elm::io::byte(), elm::io::hex(), and elm::io::pointer().

IntFormat elm::io::IntFormat::left ( void  )

Set the format to left alignment.

Returns
Built format.

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.

Returns
Built format.

References _upper.

Referenced by elm::io::lowercase().

IntFormat elm::io::IntFormat::oct ( void  )

Set the base to octal.

Returns
Built format.

References _base, and _sign.

Referenced by elm::io::oct().

IntFormat elm::io::IntFormat::operator() ( t::int8  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::operator() ( t::uint8  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::operator() ( t::int16  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::operator() ( t::uint16  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::operator() ( t::int32  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::operator() ( t::uint32  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::operator() ( t::int64  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::operator() ( t::uint64  value)

Instantiate the format for the given integer.

Parameters
valueInteger to format.
Returns
New integer format.

References _val, elm::io::f(), and elm::value().

IntFormat elm::io::IntFormat::pad ( char  p)

Set the padding character.

Parameters
pPadding characrer.
Returns
Built format.

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.

Returns
Built format.

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).

Returns
Built format.

References _displaySign.

Referenced by elm::io::sign().

IntFormat elm::io::IntFormat::upper ( void  )

Use upper case letters for base greater than 10.

Returns
Built format.

References _upper.

Referenced by elm::io::uppercase().

IntFormat elm::io::IntFormat::width ( int  w)

Set the width of the format.

Parameters
wWidth in characters.
Returns
Built format.

References _width.

Referenced by elm::io::byte(), elm::io::pointer(), and elm::io::width().

Member Data Documentation

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

Numeric base used to display the integer (default to 10).

Referenced by base(), bin(), dec(), hex(), oct(), and elm::io::Output::print().

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
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().


The documentation for this class was generated from the following files: