Aseba::FormatableString Class Reference
[General helper functions and classes]

#include <FormatableString.h>

List of all members.

Public Member Functions

template<typename T >
FormatableStringarg (const T &value)
FormatableStringarg (float value, int fieldWidth=0, int precision=6, char fillChar= ' ')
FormatableStringarg (unsigned value, int fieldWidth=0, int base=10, char fillChar= ' ')
FormatableStringarg (int value, int fieldWidth=0, int base=10, char fillChar= ' ')
template<typename T >
FormatableStringarg (const T &value)
FormatableStringarg (float value, int fieldWidth=0, int precision=6, char fillChar= ' ')
FormatableStringarg (unsigned value, int fieldWidth=0, int base=10, char fillChar= ' ')
FormatableStringarg (int value, int fieldWidth=0, int base=10, char fillChar= ' ')
 FormatableString (const std::string &s)
 FormatableString ()
 FormatableString (const std::string &s)
 FormatableString ()
FormatableStringoperator= (const std::string &str)
FormatableStringoperator= (const std::string &str)

Private Member Functions

void proceedReplace (const std::string &replacement)
void proceedReplace (const std::string &replacement)

Private Attributes

int argLevel

Detailed Description

string that can be used for argument substitution. Example : FormatableString fs("Hello %0"); cout << fs.arg("World");

Definition at line 41 of file FormatableString.h.


Constructor & Destructor Documentation

Aseba::FormatableString::FormatableString (  )  [inline]

Definition at line 56 of file FormatableString.h.

Aseba::FormatableString::FormatableString ( const std::string &  s  )  [inline]

Creates a new FormatableString with format string set to s.

Parameters:
s A string with indicators for argument substitution. Each indicator is the % symbol followed by a number. The number is the index of the corresponding argument (starting at 0).

Definition at line 63 of file FormatableString.h.

Aseba::FormatableString::FormatableString (  )  [inline]

Definition at line 56 of file FormatableString.h.

Aseba::FormatableString::FormatableString ( const std::string &  s  )  [inline]

Creates a new FormatableString with format string set to s.

Parameters:
s A string with indicators for argument substitution. Each indicator is the % symbol followed by a number. The number is the index of the corresponding argument (starting at 0).

Definition at line 63 of file FormatableString.h.


Member Function Documentation

template<typename T >
FormatableString& Aseba::FormatableString::arg ( const T &  value  )  [inline]

Replace the next arg by a value that can be passed to an ostringstream. The first call to arg replace 0, the second 1, and so on.

Parameters:
value Value used to replace the current argument.

Definition at line 101 of file FormatableString.h.

FormatableString& Aseba::FormatableString::arg ( float  value,
int  fieldWidth = 0,
int  precision = 6,
char  fillChar = ' ' 
)

Replace the next arg by a float value.

Parameters:
value Value used to replace the current argument.
fieldWidth min width of the displayed number.
precision Number of digits displayed.
fillChar Character used to pad the number to reach fieldWidth.
See also:
arg(const T& value)
FormatableString& Aseba::FormatableString::arg ( unsigned  value,
int  fieldWidth = 0,
int  base = 10,
char  fillChar = ' ' 
)

Replace the next arg by an int value.

Parameters:
value Value used to replace the current argument.
fieldWidth min width of the displayed number
base Radix of the number (8, 10 or 16)
fillChar Character used to pad the number to reach fieldWidth
See also:
arg(const T& value)
FormatableString& Aseba::FormatableString::arg ( int  value,
int  fieldWidth = 0,
int  base = 10,
char  fillChar = ' ' 
)

Replace the next arg by an int value.

Parameters:
value Value used to replace the current argument.
fieldWidth min width of the displayed number
base Radix of the number (8, 10 or 16)
fillChar Character used to pad the number to reach fieldWidth
See also:
arg(const T& value)
template<typename T >
FormatableString& Aseba::FormatableString::arg ( const T &  value  )  [inline]

Replace the next arg by a value that can be passed to an ostringstream. The first call to arg replace 0, the second 1, and so on.

Parameters:
value Value used to replace the current argument.

Definition at line 101 of file FormatableString.h.

FormatableString& Aseba::FormatableString::operator= ( const std::string &  str  ) 

Affects a new value to the format string and reset the arguments counter.

Parameters:
str New format string.
void Aseba::FormatableString::proceedReplace ( const std::string &  replacement  )  [private]

Replace the next argument by replacement.


Member Data Documentation

Next argument to be replaced.

Definition at line 47 of file FormatableString.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


asebaros
Author(s): $author
autogenerated on Mon Sep 5 08:42:13 2011