blocxx
|
This is a class similar to the blocxx format, except that all arguments are bound by reference and the formatting is performed at a later point in time. More...
#include <DelayedFormat.hpp>
Public Member Functions | |
DelayedFormat (const String &format) | |
This constructor allows for simple text output without non-format arguments. | |
template<typename A > | |
DelayedFormat (const String &format, A &a) | |
template<typename A , typename B > | |
DelayedFormat (const String &format, A &a, B &b) | |
template<typename A , typename B , typename C > | |
DelayedFormat (const String &format, A &a, B &b, C &c) | |
template<typename A , typename B , typename C , typename D > | |
DelayedFormat (const String &format, A &a, B &b, C &c, D &d) | |
template<typename A , typename B , typename C , typename D , typename E > | |
DelayedFormat (const String &format, A &a, B &b, C &c, D &d, E &e) | |
template<typename A , typename B , typename C , typename D , typename E , typename F > | |
DelayedFormat (const String &format, A &a, B &b, C &c, D &d, E &e, F &f) | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G > | |
DelayedFormat (const String &format, A &a, B &b, C &c, D &d, E &e, F &f, G &g) | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H > | |
DelayedFormat (const String &format, A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h) | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I > | |
DelayedFormat (const String &format, A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i) | |
Format | format () const |
Format the output using the stored references and initial format string. | |
operator String () const | |
Simple conversion operator. | |
Format | formatWithString (const String &fs) const |
Format the stored references using a different format string than used for initialization. | |
Format | formatWithString (const char *fs) const |
Private Types | |
typedef Reference < DelayedFormatInternals::DelayedFormatReferenceBase > | paramEntry |
Private Member Functions | |
template<class T > | |
void | append (T &t) |
This is a helper function to keep the various constructors simple. | |
Private Attributes | |
String | formatString |
The format string which will be passed to Format() when formatting this object. | |
Array< paramEntry > | formatParameters |
The parameters that will be passed to format. |
This is a class similar to the blocxx format, except that all arguments are bound by reference and the formatting is performed at a later point in time.
Because the references are stored, no temporary values can be passed to the delayed formatter; store them in a variable first.
For clarity and emphasis it is important to restate that NOTHING (except the format string) can be passed to this formatter whose lifetime does not exceed the instance of this formatter.
Definition at line 104 of file DelayedFormat.hpp.
typedef Reference<DelayedFormatInternals::DelayedFormatReferenceBase> BLOCXX_NAMESPACE::DelayedFormat::paramEntry [private] |
Definition at line 150 of file DelayedFormat.hpp.
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format | ) |
This constructor allows for simple text output without non-format arguments.
The blocxx::Format class does not allow such behavior, as such, an empty string will be used as a parameter for creation of the output Format object. That means that 1 will be a valid format conversion, but it will always be empty.
Definition at line 64 of file DelayedFormat.cpp.
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a | ||
) |
Definition at line 163 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b | ||
) |
Definition at line 171 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b, | ||
C & | c | ||
) |
Definition at line 179 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b, | ||
C & | c, | ||
D & | d | ||
) |
Definition at line 187 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b, | ||
C & | c, | ||
D & | d, | ||
E & | e | ||
) |
Definition at line 195 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b, | ||
C & | c, | ||
D & | d, | ||
E & | e, | ||
F & | f | ||
) |
Definition at line 203 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b, | ||
C & | c, | ||
D & | d, | ||
E & | e, | ||
F & | f, | ||
G & | g | ||
) |
Definition at line 211 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b, | ||
C & | c, | ||
D & | d, | ||
E & | e, | ||
F & | f, | ||
G & | g, | ||
H & | h | ||
) |
Definition at line 219 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat | ( | const String & | format, |
A & | a, | ||
B & | b, | ||
C & | c, | ||
D & | d, | ||
E & | e, | ||
F & | f, | ||
G & | g, | ||
H & | h, | ||
I & | i | ||
) |
Definition at line 227 of file DelayedFormat.hpp.
References append(), formatParameters, and BLOCXX_NAMESPACE::Array< T >::reserve().
void BLOCXX_NAMESPACE::DelayedFormat::append | ( | T & | t | ) | [private] |
This is a helper function to keep the various constructors simple.
Definition at line 156 of file DelayedFormat.hpp.
References BLOCXX_NAMESPACE::Array< T >::append(), and formatParameters.
Referenced by DelayedFormat().
Format BLOCXX_NAMESPACE::DelayedFormat::format | ( | ) | const |
Format the output using the stored references and initial format string.
Definition at line 74 of file DelayedFormat.cpp.
References BLOCXX_NAMESPACE::String::c_str(), formatString, and formatWithString().
Referenced by operator String().
Format BLOCXX_NAMESPACE::DelayedFormat::formatWithString | ( | const char * | fs | ) | const |
Definition at line 84 of file DelayedFormat.cpp.
References BLOCXX_ASSERT, formatParameters, and BLOCXX_NAMESPACE::Array< T >::size().
Format the stored references using a different format string than used for initialization.
Definition at line 79 of file DelayedFormat.cpp.
References BLOCXX_NAMESPACE::String::c_str().
Referenced by format().
BLOCXX_NAMESPACE::DelayedFormat::operator String | ( | ) | const |
Simple conversion operator.
Definition at line 69 of file DelayedFormat.cpp.
References format(), and BLOCXX_NAMESPACE::Format::toString().
The parameters that will be passed to format.
Definition at line 152 of file DelayedFormat.hpp.
Referenced by append(), DelayedFormat(), and formatWithString().
The format string which will be passed to Format() when formatting this object.
Definition at line 149 of file DelayedFormat.hpp.
Referenced by format().