#include <FormatableString.h>
List of all members.
Public Member Functions |
template<typename T > |
FormatableString & | arg (const T &value) |
FormatableString & | arg (float value, int fieldWidth=0, int precision=6, char fillChar= ' ') |
FormatableString & | arg (unsigned value, int fieldWidth=0, int base=10, char fillChar= ' ') |
FormatableString & | arg (int value, int fieldWidth=0, int base=10, char fillChar= ' ') |
template<typename T > |
FormatableString & | arg (const T &value) |
FormatableString & | arg (float value, int fieldWidth=0, int precision=6, char fillChar= ' ') |
FormatableString & | arg (unsigned value, int fieldWidth=0, int base=10, char fillChar= ' ') |
FormatableString & | arg (int value, int fieldWidth=0, int base=10, char fillChar= ' ') |
| FormatableString (const std::string &s) |
| FormatableString () |
| FormatableString (const std::string &s) |
| FormatableString () |
FormatableString & | operator= (const std::string &str) |
FormatableString & | operator= (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] |
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] |
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
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)
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:
-
void Aseba::FormatableString::proceedReplace |
( |
const std::string & |
replacement |
) |
[private] |
Replace the next argument by replacement.
Member Data Documentation
The documentation for this class was generated from the following files: