Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
StringFormat Class Reference

#include <elm/io/Output.h>

Public Member Functions

 StringFormat (void)
 
 StringFormat (string str)
 
StringFormatoperator() (string str)
 
StringFormatwidth (int w)
 
StringFormatalign (alignment_t a)
 
StringFormatleft (void)
 
StringFormatcenter (void)
 
StringFormatright (void)
 
StringFormatpad (char p)
 

Public Attributes

string s
 
unsigned char _width
 
unsigned char _align: 2
 
unsigned char _pad
 

Detailed Description

Store formatting information for character string. To automatically build a string format, uses the fmt() function.

Constructor & Destructor Documentation

◆ StringFormat() [1/2]

StringFormat ( void  )
inline

◆ StringFormat() [2/2]

StringFormat ( string  str)
inline

Member Function Documentation

◆ align()

StringFormat align ( alignment_t  a)
inline

Select alignment position when string is bigger than the selected width. Default alignment value is left.

Parameters
aOne of LEFT, CENTER or RIGHT.

References StringFormat::_align.

◆ center()

StringFormat center ( void  )
inline

center string display.

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

◆ left()

StringFormat left ( void  )
inline

Align string display to left.

References StringFormat::_align, and elm::io::LEFT.

◆ operator()()

StringFormat& operator() ( string  str)
inline

References StringFormat::s, and elm::str().

◆ pad()

StringFormat pad ( char  p)
inline

Select the padding character when a width is selected. As a default, it is a space.

Parameters
pPadding character.

References StringFormat::_pad, and elm::io::p().

◆ right()

StringFormat right ( void  )
inline

Align string display to right.

References StringFormat::_align, and elm::io::RIGHT.

◆ width()

StringFormat width ( int  w)
inline

Select width of the display. As a default, there is o width and the full string is displayed.

Parameters
wWidth in character.

References StringFormat::_width.

Member Data Documentation

◆ _align

◆ _pad

unsigned char _pad

Referenced by StringFormat::pad().

◆ _width

unsigned char _width

Referenced by StringFormat::width().

◆ s


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