Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
fmt Namespace Reference

Namespaces

namespace  anonymous_namespace{format.cc}
 
namespace  internal
 

Classes

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

Typedefs

typedef BasicWriter< charWriter
 
typedef BasicWriter< wchar_tWWriter
 
typedef BasicStringRef< charStringRef
 
typedef BasicStringRef< wchar_tWStringRef
 
typedef BasicCStringRef< charCStringRef
 
typedef BasicCStringRef< wchar_tWCStringRef
 
typedef BasicMemoryWriter< charMemoryWriter
 
typedef BasicMemoryWriter< wchar_tWMemoryWriter
 
typedef BasicArrayWriter< charArrayWriter
 
typedef BasicArrayWriter< wchar_tWArrayWriter
 
typedef BasicStringWriter< charStringWriter
 
typedef BasicStringWriter< wchar_tWStringWriter
 

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_tpad (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::NamedArgWithType< char, Targ (StringRef name, const T &arg)
 
template<typename T >
internal::NamedArgWithType< wchar_t, Targ (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
 
template<typename It >
ArgJoin< char, It > join (It first, It last, const BasicCStringRef< char > &sep)
 
template<typename It >
ArgJoin< wchar_t, It > join (It first, It last, const BasicCStringRef< wchar_t > &sep)
 
template<typename ArgFormatter , typename Char , typename It >
void format_arg (fmt::BasicFormatter< Char, ArgFormatter > &f, const Char *&format_str, const ArgJoin< Char, It > &e)
 
template<typename T >
std::string to_string (const T &value)
 
template<typename T >
std::wstring to_wstring (const T &value)
 
FMT_FUNC void print (std::ostream &os, CStringRef format_str, ArgList args)
 
template<typename Char , typename ArgFormatter_ , typename T >
void format_arg (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)
 
FMT_FUNC int fprintf (std::FILE *f, CStringRef format, ArgList args)
 
void printf (Writer &w, CStringRef format, ArgList args)
 
void printf (WWriter &w, WCStringRef format, ArgList args)
 
std::string sprintf (CStringRef format, ArgList args)
 
std::wstring sprintf (WCStringRef format, ArgList args)
 
int printf (CStringRef format, ArgList args)
 
int fprintf (std::ostream &os, CStringRef format_str, ArgList args)
 
template<typename ArgFormatter >
void format_arg (BasicFormatter< char, ArgFormatter > &f, const char *&format_str, const std::tm &tm)
 
std::tm localtime (std::time_t time)
 
std::tm gmtime (std::time_t time)
 

Variables

FMT_GCC_EXTENSION typedef long long LongLong
 
FMT_GCC_EXTENSION typedef unsigned long long ULongLong
 

Typedef Documentation

◆ ArrayWriter

◆ CStringRef

Definition at line 680 of file format.h.

◆ MemoryWriter

◆ StringRef

Definition at line 629 of file format.h.

◆ StringWriter

◆ WArrayWriter

◆ WCStringRef

◆ WMemoryWriter

◆ Writer

Definition at line 496 of file format.h.

◆ WStringRef

Definition at line 630 of file format.h.

◆ WStringWriter

◆ WWriter

Definition at line 497 of file format.h.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
SIGN_FLAG 
PLUS_FLAG 
MINUS_FLAG 
HASH_FLAG 
CHAR_FLAG 

Definition at line 1798 of file format.h.

◆ Alignment

Enumerator
ALIGN_DEFAULT 
ALIGN_LEFT 
ALIGN_RIGHT 
ALIGN_CENTER 
ALIGN_NUMERIC 

Definition at line 1793 of file format.h.

◆ Color

Enumerator
BLACK 
RED 
GREEN 
YELLOW 
BLUE 
MAGENTA 
CYAN 
WHITE 

Definition at line 3424 of file format.h.

Function Documentation

◆ arg() [1/4]

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

\rst Returns a named argument for formatting functions.

Example**::

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

\endrst

Definition at line 3593 of file format.h.

◆ arg() [2/4]

template<typename Char >
void fmt::arg ( StringRef ,
const internal::NamedArg< Char > &  )

◆ arg() [3/4]

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

Definition at line 3598 of file format.h.

◆ arg() [4/4]

template<typename Char >
void fmt::arg ( WStringRef ,
const internal::NamedArg< Char > &  )

◆ bin()

IntFormatSpec< int, TypeSpec< 'b'> > fmt::bin ( int value)

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

◆ format() [1/2]

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

\rst Formats arguments and returns the result as a string.

Example**::

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

Definition at line 3443 of file format.h.

◆ format() [2/2]

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

Definition at line 3449 of file format.h.

◆ format_arg() [1/3]

template<typename ArgFormatter >
void fmt::format_arg ( BasicFormatter< char, ArgFormatter > & f,
const char *& format_str,
const std::tm & tm )

Definition at line 24 of file time.h.

◆ format_arg() [2/3]

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

Definition at line 77 of file ostream.h.

◆ format_arg() [3/3]

template<typename ArgFormatter , typename Char , typename It >
void fmt::format_arg ( fmt::BasicFormatter< Char, ArgFormatter > & f,
const Char *& format_str,
const ArgJoin< Char, It > & e )

Definition at line 4070 of file format.h.

◆ format_decimal()

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

Definition at line 3560 of file format.h.

◆ format_system_error()

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

\rst 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. \endrst

Definition at line 388 of file format.cc.

+ Here is the call graph for this function:

◆ fprintf() [1/2]

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

\rst Prints formatted data to the file f.

Example**::

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

Definition at line 18 of file printf.cc.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprintf() [2/2]

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

\rst Prints formatted data to the stream os.

Example**::

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

Definition at line 590 of file printf.h.

+ Here is the call graph for this function:

◆ getpagesize()

long fmt::getpagesize ( )

Definition at line 230 of file posix.cc.

◆ gmtime()

std::tm fmt::gmtime ( std::time_t time)
inline

Definition at line 103 of file time.h.

+ Here is the call graph for this function:

◆ hex()

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.

◆ hexu()

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.

◆ join() [1/2]

template<typename It >
ArgJoin< char, It > fmt::join ( It first,
It last,
const BasicCStringRef< char > & sep )

Definition at line 4046 of file format.h.

◆ join() [2/2]

template<typename It >
ArgJoin< wchar_t, It > fmt::join ( It first,
It last,
const BasicCStringRef< wchar_t > & sep )

Definition at line 4051 of file format.h.

◆ localtime()

std::tm fmt::localtime ( std::time_t time)
inline

Definition at line 66 of file time.h.

+ Here is the call graph for this function:

◆ oct()

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

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

◆ pad() [1/3]

template<typename Char >
StrFormatSpec< Char > fmt::pad ( const Char * str,
unsigned width,
Char fill = ' ' )
inline

\rst 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 "

\endrst

Definition at line 2007 of file format.h.

◆ pad() [2/3]

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

Definition at line 2012 of file format.h.

◆ pad() [3/3]

template<char TYPE_CODE, typename Char >
IntFormatSpec< int, AlignTypeSpec< TYPE_CODE >, Char > fmt::pad ( int value,
unsigned width,
Char fill = ' ' )

\rst 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"

\endrst

◆ print() [1/3]

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

\rst Prints formatted data to stdout.

Example**::

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

Definition at line 449 of file format.cc.

◆ print() [2/3]

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

\rst Prints formatted data to the file f.

Example**::

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

Definition at line 443 of file format.cc.

◆ print() [3/3]

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

\rst Prints formatted data to the stream os.

Example**::

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

Definition at line 30 of file ostream.cc.

+ Here is the call graph for this function:

◆ print_colored()

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 453 of file format.cc.

◆ printf() [1/4]

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

◆ printf() [2/4]

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

\rst Prints formatted data to stdout.

Example**::

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

Definition at line 576 of file printf.h.

+ Here is the call graph for this function:

◆ printf() [3/4]

void fmt::printf ( Writer & w,
CStringRef format,
ArgList args )
inline

Definition at line 522 of file printf.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printf() [4/4]

void fmt::printf ( WWriter & w,
WCStringRef format,
ArgList args )
inline

Definition at line 527 of file printf.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ report_system_error()

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

Definition at line 429 of file format.cc.

+ Here is the call graph for this function:

◆ sprintf() [1/2]

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

\rst Formats arguments and returns the result as a string.

Example**::

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

Definition at line 541 of file printf.h.

+ Here is the call graph for this function:

◆ sprintf() [2/2]

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

Definition at line 548 of file printf.h.

+ Here is the call graph for this function:

◆ to_string()

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

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

Example**::

#include "fmt/string.h"

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

Definition at line 123 of file string.h.

◆ to_wstring()

template<typename T >
std::wstring fmt::to_wstring ( const T & value)

\rst Converts value to std::wstring using the default format for type T.

Example**::

#include "fmt/string.h"

std::wstring answer = fmt::to_wstring(42); \endrst

Definition at line 141 of file string.h.

Variable Documentation

◆ LongLong

Definition at line 486 of file format.h.

◆ ULongLong

Definition at line 487 of file format.h.