Flow123d  release_3.0.0-1133-g1943bc6
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
fmt Namespace Reference

Namespaces

 internal
 

Classes

struct  AlignSpec
 
struct  AlignTypeSpec
 
class  ArgFormatter
 
class  ArgList
 
class  ArgVisitor
 
class  BasicArgFormatter
 
class  BasicArrayWriter
 
class  BasicCStringRef
 
class  BasicFormatter
 
class  BasicMemoryWriter
 
class  BasicStringRef
 
class  BasicWriter
 
class  Buffer
 
class  BufferedFile
 
struct  EmptySpec
 
class  ErrorCode
 
class  File
 
class  FormatError
 
class  FormatInt
 
struct  FormatSpec
 
class  IntFormatSpec
 
class  StrFormatSpec
 
class  SystemError
 
struct  TypeSpec
 
struct  WidthSpec
 

Typedefs

typedef BasicWriter< char > Writer
 
typedef BasicWriter< wchar_t > WWriter
 
typedef BasicStringRef< char > StringRef
 
typedef BasicStringRef< wchar_t > WStringRef
 
typedef BasicCStringRef< char > CStringRef
 
typedef BasicCStringRef< wchar_t > WCStringRef
 
typedef BasicMemoryWriter< char > MemoryWriter
 
typedef BasicMemoryWriter< wchar_t > WMemoryWriter
 
typedef BasicArrayWriter< char > ArrayWriter
 
typedef BasicArrayWriter< wchar_t > WArrayWriter
 

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

IntFormatSpec< int, TypeSpec<'b'> > bin (int value)
 
IntFormatSpec< int, TypeSpec<'o'> > oct (int value)
 
IntFormatSpec< int, TypeSpec<'x'> > hex (int value)
 
IntFormatSpec< int, TypeSpec<'X'> > hexu (int value)
 
template<char TYPE_CODE, typename Char >
IntFormatSpec< int, AlignTypeSpec< TYPE_CODE >, Char > pad (int value, unsigned width, Char fill= ' ')
 
template<typename Char >
StrFormatSpec< Char > pad (const Char *str, unsigned width, Char fill= ' ')
 
StrFormatSpec< wchar_t > pad (const wchar_t *str, unsigned width, char fill= ' ')
 
FMT_API void format_system_error (fmt::Writer &out, int error_code, fmt::StringRef message) FMT_NOEXCEPT
 
FMT_API void report_system_error (int error_code, StringRef message) FMT_NOEXCEPT
 
FMT_API void print_colored (Color c, CStringRef format, ArgList args)
 
std::string format (CStringRef format_str, ArgList args)
 
std::wstring format (WCStringRef format_str, ArgList args)
 
FMT_API void print (std::FILE *f, CStringRef format_str, ArgList args)
 
FMT_API void print (CStringRef format_str, ArgList args)
 
template<typename T >
void format_decimal (char *&buffer, T value)
 
template<typename T >
internal::NamedArg< char > arg (StringRef name, const T &arg)
 
template<typename T >
internal::NamedArg< wchar_t > arg (WStringRef name, const T &arg)
 
template<typename Char >
void arg (StringRef, const internal::NamedArg< Char > &) FMT_DELETED_OR_UNDEFINED
 
template<typename Char >
void arg (WStringRef, const internal::NamedArg< Char > &) FMT_DELETED_OR_UNDEFINED
 
FMT_FUNC void print (std::ostream &os, CStringRef format_str, ArgList args)
 
FMT_FUNC int fprintf (std::ostream &os, CStringRef format, ArgList args)
 
template<typename Char , typename ArgFormatter , typename T >
void format (BasicFormatter< Char, ArgFormatter > &f, const Char *&format_str, const T &value)
 
long getpagesize ()
 
template<typename Char >
void printf (BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
 
std::string sprintf (CStringRef format, ArgList args)
 
std::wstring sprintf (WCStringRef format, ArgList args)
 
FMT_API int fprintf (std::FILE *f, CStringRef format, ArgList args)
 
int printf (CStringRef format, ArgList args)
 
template<typename T >
std::string to_string (const T &value)
 

Variables

FMT_GCC_EXTENSION typedef long long LongLong
 
FMT_GCC_EXTENSION typedef unsigned long long ULongLong
 

Typedef Documentation

Definition at line 3065 of file format.h.

Definition at line 531 of file format.h.

Definition at line 3016 of file format.h.

Definition at line 483 of file format.h.

Definition at line 3066 of file format.h.

Definition at line 532 of file format.h.

Definition at line 3017 of file format.h.

typedef BasicWriter<char> fmt::Writer

Definition at line 376 of file format.h.

typedef BasicStringRef<wchar_t> fmt::WStringRef

Definition at line 484 of file format.h.

typedef BasicWriter<wchar_t> fmt::WWriter

Definition at line 379 of file format.h.

Enumeration Type Documentation

anonymous enum
Enumerator
SIGN_FLAG 
PLUS_FLAG 
MINUS_FLAG 
HASH_FLAG 
CHAR_FLAG 

Definition at line 1558 of file format.h.

Enumerator
ALIGN_DEFAULT 
ALIGN_LEFT 
ALIGN_RIGHT 
ALIGN_CENTER 
ALIGN_NUMERIC 

Definition at line 1553 of file format.h.

enum fmt::Color
Enumerator
BLACK 
RED 
GREEN 
YELLOW 
BLUE 
MAGENTA 
CYAN 
WHITE 

Definition at line 3122 of file format.h.

Function Documentation

template<typename T >
internal::NamedArg<char> fmt::arg ( StringRef  name,
const T &  arg 
)
inline

Returns a named argument for formatting functions.

Example**::

print("Elapsed time: {s:.2f} seconds", arg("s", 1.23));

Definition at line 3291 of file format.h.

Here is the caller graph for this function:

template<typename T >
internal::NamedArg<wchar_t> fmt::arg ( WStringRef  name,
const T &  arg 
)
inline

Definition at line 3296 of file format.h.

template<typename Char >
void fmt::arg ( StringRef  ,
const internal::NamedArg< Char > &   
)
template<typename Char >
void fmt::arg ( WStringRef  ,
const internal::NamedArg< Char > &   
)
IntFormatSpec<int, TypeSpec<'b'> > fmt::bin ( int  value)

Returns an integer format specifier to format the value in base 2.

Here is the caller graph for this function:

template<typename Char , typename ArgFormatter , typename T >
void fmt::format ( BasicFormatter< Char, ArgFormatter > &  f,
const Char *&  format_str,
const T &  value 
)

Definition at line 91 of file ostream.h.

std::string fmt::format ( CStringRef  format_str,
ArgList  args 
)
inline

Formats arguments and returns the result as a string.

Example**::

std::string message = format("The answer is {}", 42);

Definition at line 3141 of file format.h.

std::wstring fmt::format ( WCStringRef  format_str,
ArgList  args 
)
inline

Definition at line 3147 of file format.h.

template<typename T >
void fmt::format_decimal ( char *&  buffer,
value 
)
inline

Definition at line 3258 of file format.h.

FMT_FUNC void fmt::format_system_error ( fmt::Writer out,
int  error_code,
fmt::StringRef  message 
)

Formats an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out in the following form:

.. parsed-literal:: <message>*: *<system-message>*

where *<message>* is the passed message and *<system-message>* is the system message corresponding to the error code. error_code* is a system error code as given by errno. If error_code is not a valid error code such as -1, the system message may look like "Unknown error -1" and is platform-dependent.

Definition at line 388 of file format.cc.

Here is the caller graph for this function:

FMT_API int fmt::fprintf ( std::ostream &  os,
CStringRef  format_str,
ArgList  args 
)

Prints formatted data to the stream os.

Example**::

fprintf(cerr, "Don't %s!", "panic");

Definition at line 56 of file ostream.cc.

Here is the caller graph for this function:

FMT_FUNC int fmt::fprintf ( std::FILE *  f,
CStringRef  format,
ArgList  args 
)

Prints formatted data to the file f.

Example**::

fmt::fprintf(stderr, "Don't %s!", "panic");

Definition at line 507 of file format.cc.

long fmt::getpagesize ( )

Definition at line 245 of file posix.cc.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

IntFormatSpec<int, TypeSpec<'o'> > fmt::oct ( int  value)

Returns an integer format specifier to format the value in base 8.

Here is the caller graph for this function:

template<char TYPE_CODE, typename Char >
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**::

MemoryWriter out; out << pad(hex(0xcafe), 8, '0'); out.str() == "0000cafe"

Here is the caller graph for this function:

template<typename Char >
StrFormatSpec<Char> fmt::pad ( const Char *  str,
unsigned  width,
Char  fill = ' ' 
)
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(MemoryWriter() << pad("abc", 8)); s == "abc "

Definition at line 1764 of file format.h.

StrFormatSpec<wchar_t> fmt::pad ( const wchar_t *  str,
unsigned  width,
char  fill = ' ' 
)
inline

Definition at line 1769 of file format.h.

FMT_API void fmt::print ( std::ostream &  os,
CStringRef  format_str,
ArgList  args 
)

Prints formatted data to the stream os.

Example**::

print(cerr, "Don't {}!", "panic");

Definition at line 50 of file ostream.cc.

FMT_FUNC void fmt::print ( std::FILE *  f,
CStringRef  format_str,
ArgList  args 
)

Prints formatted data to the file f.

Example**::

print(stderr, "Don't {}!", "panic");

Definition at line 489 of file format.cc.

Here is the caller graph for this function:

FMT_FUNC void fmt::print ( CStringRef  format_str,
ArgList  args 
)

Prints formatted data to stdout.

Example**::

print("Elapsed time: {0:.2f} seconds", 1.23);

Definition at line 495 of file format.cc.

FMT_FUNC void fmt::print_colored ( Color  c,
CStringRef  format,
ArgList  args 
)

Formats a string and prints it to stdout using ANSI escape sequences to specify color (experimental). Example: print_colored(fmt::RED, "Elapsed time: {0:.2f} seconds", 1.23);

Definition at line 499 of file format.cc.

template<typename Char >
void fmt::printf ( BasicWriter< Char > &  w,
BasicCStringRef< Char >  format,
ArgList  args 
)

Definition at line 444 of file printf.h.

int fmt::printf ( CStringRef  format,
ArgList  args 
)
inline

Prints formatted data to stdout.

Example**::

fmt::printf("Elapsed time: %.2f seconds", 1.23);

Definition at line 492 of file printf.h.

FMT_FUNC void fmt::report_system_error ( int  error_code,
fmt::StringRef  message 
)

Definition at line 475 of file format.cc.

Here is the caller graph for this function:

std::string fmt::sprintf ( CStringRef  format,
ArgList  args 
)
inline

Formats arguments and returns the result as a string.

Example**::

std::string message = fmt::sprintf("The answer is %d", 42);

Definition at line 457 of file printf.h.

Here is the caller graph for this function:

std::wstring fmt::sprintf ( WCStringRef  format,
ArgList  args 
)
inline

Definition at line 464 of file printf.h.

template<typename T >
std::string fmt::to_string ( const T &  value)

Converts value to std::string using the default format for type T.

Example**::

#include "fmt/string.h"

std::string answer = fmt::to_string(42);

Definition at line 29 of file string.h.

Here is the caller graph for this function:

Variable Documentation

FMT_GCC_EXTENSION typedef long long fmt::LongLong

Definition at line 368 of file format.h.

FMT_GCC_EXTENSION typedef unsigned long long fmt::ULongLong

Definition at line 369 of file format.h.