Pyrogenesis
trunk
|
Namespaces | |
internal | |
Classes | |
struct | AlignSpec |
struct | AlignTypeSpec |
class | ArgList |
An argument list. More... | |
class | BasicFormatter |
class | BasicStringRef |
A string reference. More... | |
class | BasicWriter |
This template provides operations for formatting and writing data into a character stream. More... | |
struct | EmptySpec |
class | FormatError |
A formatting error such as invalid format string. More... | |
class | FormatInt |
Fast integer formatter. More... | |
struct | FormatSpec |
class | IntFormatSpec |
class | StrFormatSpec |
class | SystemError |
An error returned by an operating system or a language runtime, for example a file opening error. More... | |
struct | TypeSpec |
struct | WidthSpec |
Typedefs | |
typedef BasicWriter< char > | Writer |
typedef BasicWriter< wchar_t > | WWriter |
typedef BasicStringRef< char > | StringRef |
typedef BasicStringRef< wchar_t > | WStringRef |
Enumerations | |
enum | Alignment { ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_NUMERIC } |
enum | { SIGN_FLAG = 1, PLUS_FLAG = 2, MINUS_FLAG = 4, HASH_FLAG = 8, CHAR_FLAG = 0x10 } |
enum | Color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE } |
Functions | |
template<typename Char , typename T > | |
void | format (BasicFormatter< Char > &f, const Char *format_str, const T &value) |
IntFormatSpec< int, TypeSpec<'b'> > | bin (int value) |
Returns an integer format specifier to format the value in base 2. More... | |
IntFormatSpec< int, TypeSpec<'o'> > | oct (int value) |
Returns an integer format specifier to format the value in base 8. More... | |
IntFormatSpec< int, TypeSpec<'x'> > | hex (int value) |
Returns an integer format specifier to format the value in base 16 using lower-case letters for the digits above 9. More... | |
IntFormatSpec< int, TypeSpec<'X'> > | hexu (int value) |
Returns an integer formatter format specifier to format in base 16 using upper-case letters for the digits above 9. More... | |
template<char TYPE_CODE, typename Char > | |
IntFormatSpec< int, AlignTypeSpec< TYPE_CODE >, Char > | pad (int value, unsigned width, Char fill= ' ') |
Returns an integer format specifier to pad the formatted argument with the fill character to the specified width using the default (right) numeric alignment. More... | |
template<typename Char > | |
StrFormatSpec< Char > | pad (const Char *str, unsigned width, Char fill= ' ') |
Returns a string formatter that pads the formatted argument with the fill character to the specified width using the default (left) string alignment. More... | |
StrFormatSpec< wchar_t > | pad (const wchar_t *str, unsigned width, char fill= ' ') |
void | report_system_error (int error_code, StringRef message) FMT_NOEXCEPT(true) |
void | print_colored (Color c, StringRef format, const ArgList &args) |
Formats a string and prints it to stdout using ANSI escape sequences to specify color (experimental). More... | |
std::string | format (StringRef format_str, const ArgList &args) |
Formats arguments and returns the result as a string. More... | |
std::wstring | format (WStringRef format_str, const ArgList &args) |
void | print (std::FILE *f, StringRef format_str, const ArgList &args) |
Prints formatted data to the file f. More... | |
void | print (StringRef format_str, const ArgList &args) |
Prints formatted data to stdout . More... | |
void | print (std::ostream &os, StringRef format_str, const ArgList &args) |
Prints formatted data to the stream os. More... | |
template<typename Char > | |
void | printf (BasicWriter< Char > &w, BasicStringRef< Char > format, const ArgList &args) |
std::string | sprintf (StringRef format, const ArgList &args) |
Formats arguments and returns the result as a string. More... | |
int | fprintf (std::FILE *f, StringRef format, const ArgList &args) |
Prints formatted data to the file f. More... | |
int | printf (StringRef format, const ArgList &args) |
Prints formatted data to stdout . More... | |
template<typename T > | |
void | format_decimal (char *&buffer, T value) |
Variables | |
FMT_GCC_EXTENSION typedef long long | LongLong |
FMT_GCC_EXTENSION typedef unsigned long long | ULongLong |
typedef BasicStringRef<char> fmt::StringRef |
typedef BasicWriter<char> fmt::Writer |
typedef BasicStringRef<wchar_t> fmt::WStringRef |
typedef BasicWriter<wchar_t> fmt::WWriter |
enum fmt::Alignment |
enum fmt::Color |
IntFormatSpec<int, TypeSpec<'b'> > fmt::bin | ( | int | value | ) |
Returns an integer format specifier to format the value in base 2.
void fmt::format | ( | BasicFormatter< Char > & | f, |
const Char * | format_str, | ||
const T & | value | ||
) |
Formats arguments and returns the result as a string.
Example**::
std::string message = format("The answer is {}", 42);
|
inline |
|
inline |
IntFormatSpec<int, TypeSpec<'x'> > fmt::hex | ( | int | value | ) |
Returns an integer format specifier to format the value in base 16 using lower-case letters for the digits above 9.
IntFormatSpec<int, TypeSpec<'X'> > fmt::hexu | ( | int | value | ) |
Returns an integer formatter format specifier to format in base 16 using upper-case letters for the digits above 9.
IntFormatSpec<int, TypeSpec<'o'> > fmt::oct | ( | int | value | ) |
Returns an integer format specifier to format the value in base 8.
IntFormatSpec<int, AlignTypeSpec<TYPE_CODE>, Char> fmt::pad | ( | int | value, |
unsigned | width, | ||
Char | fill = ' ' |
||
) |
Returns an integer format specifier to pad the formatted argument with the fill character to the specified width using the default (right) numeric alignment.
Example**::
Writer out; out << pad(hex(0xcafe), 8, '0'); out.str() == "0000cafe"
|
inline |
Returns a string formatter that pads the formatted argument with the fill character to the specified width using the default (left) string alignment.
Example**::
std::string s = str(Writer() << pad("abc", 8)); s == "abc "
|
inline |
Prints formatted data to the file f.
Example**::
print(stderr, "Don't {}!", "panic");
Prints formatted data to stdout
.
Example**::
print("Elapsed time: {0:.2f} seconds", 1.23);
Prints formatted data to the stream os.
Example**::
print(cerr, "Don't {}!", "panic");
Formats a string and prints it to stdout using ANSI escape sequences to specify color (experimental).
Example: PrintColored(fmt::RED, "Elapsed time: {0:.2f} seconds") << 1.23;
void fmt::printf | ( | BasicWriter< Char > & | w, |
BasicStringRef< Char > | format, | ||
const ArgList & | args | ||
) |
void fmt::report_system_error | ( | int | error_code, |
fmt::StringRef | message | ||
) |
Formats arguments and returns the result as a string.
Example**::
std::string message = fmt::sprintf("The answer is %d", 42);
FMT_GCC_EXTENSION typedef long long fmt::LongLong |
FMT_GCC_EXTENSION typedef unsigned long long fmt::ULongLong |