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

Namespaces

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< 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
 
typedef void(* FormatFunc) (Writer &, int, StringRef)
 
typedef BasicStringWriter< char > StringWriter
 
typedef BasicStringWriter< wchar_t > WStringWriter
 

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::NamedArgWithType< char, T > arg (StringRef name, const T &arg)
 
template<typename T >
internal::NamedArgWithType< wchar_t, 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
 
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)
 
int safe_strerror (int error_code, char *&buffer, std::size_t buffer_size) FMT_NOEXCEPT
 
void format_error_code (Writer &out, int error_code, StringRef message) FMT_NOEXCEPT
 
void report_error (FormatFunc func, int error_code, StringRef message) FMT_NOEXCEPT
 
 FMT_POWERS_OF_10 (1) }
 
 FMT_POWERS_OF_10 (ULongLong(1000000000))
 
 ULongLong (1000000000) *ULongLong(1000000000) *10 }
 
 if (std::isprint(static_cast< unsigned char >(code)))
 
 FMT_THROW (FormatError(format("unknown format code '\\x{:02x}' for {}", static_cast< unsigned >(code), type)))
 
 switch (arg.type)
 
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
 
 __pad0__
 
template<typename T >
 __pad1__
 
std::size_t size
 
std::size_t const char * format
 
std::size_t const char unsigned width
 
std::size_t const char unsigned int precision
 
std::size_t const char unsigned int T value
 
template<typename T >
 __pad2__
 
template<typename T >
 __pad3__
 
template<typename T >
 __pad4__
 
template<typename T >
 __pad5__
 
 __pad6__
 
const char * type
 
template<typename Char >
 __pad7__
 
 __pad8__
 
const char *& error
 
return arg
 

Typedef Documentation

◆ ArrayWriter

Definition at line 3367 of file format.h.

◆ CStringRef

Definition at line 680 of file format.h.

◆ FormatFunc

typedef void(* fmt::FormatFunc) (Writer &, int, StringRef)
package

Definition at line 113 of file format.cc.

◆ MemoryWriter

Definition at line 3318 of file format.h.

◆ StringRef

Definition at line 629 of file format.h.

◆ StringWriter

Definition at line 108 of file string.h.

◆ WArrayWriter

Definition at line 3368 of file format.h.

◆ WCStringRef

Definition at line 681 of file format.h.

◆ WMemoryWriter

Definition at line 3319 of file format.h.

◆ Writer

typedef BasicWriter<char> fmt::Writer

Definition at line 496 of file format.h.

◆ WStringRef

typedef BasicStringRef<wchar_t> fmt::WStringRef

Definition at line 630 of file format.h.

◆ WStringWriter

Definition at line 109 of file string.h.

◆ WWriter

typedef BasicWriter<wchar_t> fmt::WWriter

Definition at line 497 of file format.h.

Enumeration Type Documentation

◆ anonymous enum

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

enum fmt::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.

◆ FMT_POWERS_OF_10() [1/2]

fmt::FMT_POWERS_OF_10 ( 1 )
package

◆ FMT_POWERS_OF_10() [2/2]

fmt::FMT_POWERS_OF_10 ( ULongLong(1000000000) )
package

◆ FMT_THROW()

fmt::FMT_THROW ( FormatError(format("unknown format code '\\x{:02x}' for {}", static_cast< unsigned >(code), type)) )
package

◆ 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.

+ Here is the caller graph for this function:

◆ 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_error_code()

void fmt::format_error_code ( Writer & out,
int error_code,
StringRef message )
package

Definition at line 191 of file format.cc.

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

◆ 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:
+ Here is the caller 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.

◆ if()

fmt::if ( std::isprint(static_cast< unsigned char >(code)) )
package

Definition at line 298 of file format.cc.

+ Here is the call graph for this function:

◆ 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.

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

◆ 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.

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

◆ 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.

+ Here is the call graph for this function:

◆ 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_error()

void fmt::report_error ( FormatFunc func,
int error_code,
StringRef message )
package

Definition at line 214 of file format.cc.

+ 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:
+ Here is the caller graph for this function:

◆ safe_strerror()

int fmt::safe_strerror ( int error_code,
char *& buffer,
std::size_t buffer_size )
package

Definition at line 124 of file format.cc.

+ Here is the call graph for this function:
+ Here is the caller 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:

◆ switch()

fmt::switch ( arg. type)
package

Definition at line 416 of file format.cc.

◆ 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.

◆ ULongLong()

fmt::ULongLong ( 1000000000 )
package

Variable Documentation

◆ __pad0__

fmt::__pad0__
package

Definition at line 86 of file format.cc.

◆ __pad1__

template<typename T >
fmt::__pad1__
package

Definition at line 235 of file format.cc.

◆ __pad2__

template<typename T >
fmt::__pad2__
package

Definition at line 249 of file format.cc.

◆ __pad3__

template<typename T >
fmt::__pad3__
package

Definition at line 263 of file format.cc.

◆ __pad4__

template<typename T >
fmt::__pad4__
package

Definition at line 282 of file format.cc.

◆ __pad5__

template<typename T >
fmt::__pad5__
package

Definition at line 287 of file format.cc.

◆ __pad6__

fmt::__pad6__
package

Definition at line 296 of file format.cc.

◆ __pad7__

template<typename Char >
fmt::__pad7__
package

Definition at line 409 of file format.cc.

◆ __pad8__

fmt::__pad8__
package

Definition at line 413 of file format.cc.

◆ arg

return fmt::arg
package

Definition at line 426 of file format.cc.

◆ error

const char*& fmt::error
package
Initial value:
{
internal::Arg arg = args_[arg_index]
return arg
Definition format.cc:426

Definition at line 414 of file format.cc.

◆ format

std::size_t const wchar_t * fmt::format
package

Definition at line 236 of file format.cc.

◆ LongLong

FMT_GCC_EXTENSION typedef long long fmt::LongLong

Definition at line 486 of file format.h.

◆ precision

std::size_t const wchar_t unsigned int fmt::precision
package

Definition at line 237 of file format.cc.

◆ size

std::size_t fmt::size
package

Definition at line 236 of file format.cc.

◆ type

const char* fmt::type
package
Initial value:
{
(void)type
const ASN1_OBJECT int type
Definition x509.h:923

Definition at line 296 of file format.cc.

◆ ULongLong

FMT_GCC_EXTENSION typedef unsigned long long fmt::ULongLong

Definition at line 487 of file format.h.

◆ value

std::size_t const wchar_t unsigned int T fmt::value
package
Initial value:
{
if (width == 0) {
return precision < 0 ?
FMT_SNPRINTF(buffer, size, format, value) :
}
return precision < 0 ?
FMT_SNPRINTF(buffer, size, format, width, value) :
#define FMT_SNPRINTF
std::size_t const char unsigned int precision
Definition format.cc:237
std::size_t const char unsigned int T value
Definition format.cc:237
std::size_t const char * format
Definition format.cc:236
std::size_t size
Definition format.cc:236
std::size_t const char unsigned width
Definition format.cc:237

Definition at line 237 of file format.cc.

◆ width

std::size_t const wchar_t unsigned fmt::width
package

Definition at line 237 of file format.cc.