#include <FormatableString.h>
Public Member Functions | |
BasicFormatableString & | arg (int value, int fieldWidth=0, int base=10, charT fillChar= ' ') |
BasicFormatableString & | arg (unsigned value, int fieldWidth=0, int base=10, charT fillChar= ' ') |
BasicFormatableString & | arg (float value, int fieldWidth=0, int precision=6, charT fillChar= ' ') |
template<typename T > | |
BasicFormatableString & | arg (const T &value) |
BasicFormatableString () | |
BasicFormatableString (const S &s) | |
BasicFormatableString & | operator= (const S &str) |
Private Types | |
typedef std::basic_string< charT > | S |
Private Member Functions | |
void | proceedReplace (const S &replacement) |
Private Attributes | |
int | argLevel |
string that can be used for argument substitution. Example : FormatableString fs("Hello %0"); cout << fs.arg("World");
Definition at line 39 of file FormatableString.h.
typedef std::basic_string<charT> Aseba::BasicFormatableString< charT >::S [private] |
Definition at line 41 of file FormatableString.h.
Aseba::BasicFormatableString< charT >::BasicFormatableString | ( | ) | [inline] |
Definition at line 56 of file FormatableString.h.
Aseba::BasicFormatableString< charT >::BasicFormatableString | ( | const S & | s | ) | [inline] |
Creates a new FormatableString with format string set to s.
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.
BasicFormatableString& Aseba::BasicFormatableString< charT >::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.
value | Value used to replace the current argument. |
Definition at line 100 of file FormatableString.h.
int Aseba::BasicFormatableString< charT >::argLevel [private] |
Next argument to be replaced.
Definition at line 47 of file FormatableString.h.