blocxx
Public Member Functions | Private Types | Private Member Functions | Private Attributes

BLOCXX_NAMESPACE::DelayedFormat Class Reference

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>

List of all members.

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< paramEntryformatParameters
 The parameters that will be passed to format.

Detailed Description

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.


Member Typedef Documentation

Definition at line 150 of file DelayedFormat.hpp.


Constructor & Destructor Documentation

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.

template<typename A >
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat ( const String format,
A &  a 
)
template<typename A , typename B >
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat ( const String format,
A &  a,
B &  b 
)
template<typename A , typename B , typename C >
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat ( const String format,
A &  a,
B &  b,
C &  c 
)
template<typename A , typename B , typename C , typename D >
BLOCXX_NAMESPACE::DelayedFormat::DelayedFormat ( const String format,
A &  a,
B &  b,
C &  c,
D &  d 
)
template<typename A , typename B , typename C , typename D , typename E >
BLOCXX_NAMESPACE::DelayedFormat::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 >
BLOCXX_NAMESPACE::DelayedFormat::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 >
BLOCXX_NAMESPACE::DelayedFormat::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 >
BLOCXX_NAMESPACE::DelayedFormat::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 >
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 
)

Member Function Documentation

template<typename T >
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
Format BLOCXX_NAMESPACE::DelayedFormat::formatWithString ( const String fs) const

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().


Member Data Documentation

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().


The documentation for this class was generated from the following files: