gatb.core-API-1.4.2
Stringify Class Reference

String helper for using printf-like formats. More...

#include <Stringify.hpp>

Static Public Member Functions

static std::string format (const char *fmt,...)
 
static std::string format (const char *fmt, va_list args)
 

Detailed Description

String helper for using printf-like formats.

The Stringify class provides the format method. Its prototype is the same as the printf function. As a result, it gives a string object holding the same text that the printf function would have produced.

cout << Stringify::format ("we got %d items which represents %f percent", 123, 57.3) << endl;

Member Function Documentation

static std::string format ( const char *  fmt,
  ... 
)
inlinestatic

Generates a string object with a printf-like prototype.

Parameters
[in]fmt: the format of the string
[in]...: variable number of arguments
Returns
the string
static std::string format ( const char *  fmt,
va_list  args 
)
inlinestatic

Generates a string object with a printf-like prototype.

Parameters
[in]fmt: the format of the string
[in]args.: list of arguments
Returns
the string

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