Contents
|
In file ../../src/Pegasus/Common/Formatter.h:
Formatter is a class to build formatted strings from strings that contain variable defintions.
Documentation
Formatter is a class to build formatted strings from
strings that contain variable defintions. The
variable definitions in the strings are of the form
$
where is a single digit integer (0 - 9).
The variable subsituted may be String, Boolean Integer, Unsigned Integer
or real.
The format subsitution may be escaped by preceding the
$ with a \
usage:
Formatter::format (FormatString, variable0,.., variable9)
Example:
int total = 4;
int count = 2;
String name = "Output"
String output = Formatter::format(
"total $0 average $1 on $2",
total,
total/count,
name);
produces the string
"total 4 average 2 on Output"
Inheritance:
Public Methods
static String | format ( const String& formatString, const Arg& arg0 = Formatter::DEFAULT_ARG, const Arg& arg1 = Formatter::DEFAULT_ARG, const Arg& arg2 = Formatter::DEFAULT_ARG, const Arg& arg3 = Formatter::DEFAULT_ARG, const Arg& arg4 = Formatter::DEFAULT_ARG, const Arg& arg5 = Formatter::DEFAULT_ARG, const Arg& arg6 = Formatter::DEFAULT_ARG, const Arg& arg7 = Formatter::DEFAULT_ARG, const Arg& arg8 = Formatter::DEFAULT_ARG, const Arg& arg9 = Formatter::DEFAULT_ARG)
Format function for the formatter
|
- static String format( const String& formatString, const Arg& arg0 = Formatter::DEFAULT_ARG, const Arg& arg1 = Formatter::DEFAULT_ARG, const Arg& arg2 = Formatter::DEFAULT_ARG, const Arg& arg3 = Formatter::DEFAULT_ARG, const Arg& arg4 = Formatter::DEFAULT_ARG, const Arg& arg5 = Formatter::DEFAULT_ARG, const Arg& arg6 = Formatter::DEFAULT_ARG, const Arg& arg7 = Formatter::DEFAULT_ARG, const Arg& arg8 = Formatter::DEFAULT_ARG, const Arg& arg9 = Formatter::DEFAULT_ARG)
- Format function for the formatter
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
|