Rosetta  3.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
fmt Namespace Reference

Namespaces

 internal
 

Classes

struct  AlignSpec
 
struct  AlignTypeSpec
 
class  ArgList
 
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

template<typename Char , typename T >
void format (BasicFormatter< Char > &f, const Char *&format_str, const T &value)
 
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= ' ')
 
void report_system_error (int error_code, StringRef message) FMT_NOEXCEPT
 
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)
 
void print (std::FILE *f, CStringRef format_str, ArgList args)
 
void print (CStringRef format_str, ArgList args)
 
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)
 
int fprintf (std::FILE *f, CStringRef format, ArgList args)
 
int printf (CStringRef format, 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
 
void print (std::ostream &os, CStringRef format_str, ArgList args)
 
long getpagesize ()
 

Variables

FMT_GCC_EXTENSION typedef long long LongLong
 
FMT_GCC_EXTENSION typedef
unsigned long long 
ULongLong
 

Typedef Documentation

Enumeration Type Documentation

anonymous enum
Enumerator
SIGN_FLAG 
PLUS_FLAG 
MINUS_FLAG 
HASH_FLAG 
CHAR_FLAG 
Enumerator
ALIGN_DEFAULT 
ALIGN_LEFT 
ALIGN_RIGHT 
ALIGN_CENTER 
ALIGN_NUMERIC 
enum fmt::Color
Enumerator
BLACK 
RED 
GREEN 
YELLOW 
BLUE 
MAGENTA 
CYAN 
WHITE 

Function Documentation

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

References arg(), and name.

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.

template<typename Char , typename T >
void fmt::format ( BasicFormatter< Char > &  f,
const Char *&  format_str,
const T &  value 
)
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);

References fmt::BasicWriter< Char >::str(), numeric::statistics::w(), and fmt::BasicWriter< Char >::write().

std::wstring fmt::format ( WCStringRef  format_str,
ArgList  args 
)
inline
template<typename T >
void fmt::format_decimal ( char *&  buffer,
value 
)
inline
FMT_FUNC int fmt::fprintf ( std::FILE *  f,
CStringRef  format,
ArgList  args 
)
long fmt::getpagesize ( )
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.

Referenced by basic::Emitter::escape_string(), and utility::string_to_sha1().

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.

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"

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 "

References basic::options::OptionKeys::mp::visualize::width.

StrFormatSpec<wchar_t> fmt::pad ( const wchar_t *  str,
unsigned  width,
char  fill = ' ' 
)
inline
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");

References fmt::BasicWriter< Char >::data(), demo.D060_Folding::f, fmt::BasicWriter< Char >::size(), numeric::statistics::w(), and fmt::BasicWriter< Char >::write().

Referenced by test.T850_SubClassing.PyValue::__init__(), test.T850_SubClassing.A::__init__(), test.T850_SubClassing.My_New_Mover::__init__(), test.T850_SubClassing.MyNewCI1B::__init__(), test.Workshop9_my_shapes.PhiNByXDegreesMover::apply(), test.T850_SubClassing.My_New_Mover::apply(), pyrosetta.toolbox::cleanATOM(), pyrosetta.toolbox::cleanCRYS(), build::create_package(), test.T870_SubClassing_EnergyMethods2.CI2B_Method::eval_intrares_energy(), test.T870_SubClassing_EnergyMethods2.CD2B_Method::eval_intrares_energy(), self-test::execute(), build::execute(), exclude::filter_code_creators(), test.T850_SubClassing.A::foo_value_sp(), pyrosetta.toolbox::get_secstruct(), test.T850_SubClassing.MyNewCI1B::indicate_required_context_graphs(), build::install_llvm_tool(), build::install_pybind11(), pyrosetta.toolbox::load_from_rcsb(), self-test::main(), build::main(), app.pyrosetta_toolkit.modules.prettytable.prettytable::main(), self-test::mfork(), test.T007_TracerIO.MyPyTracer::output_callback(), fmt::BufferedFile::print(), print(), print_colored(), test.T850_SubClassing.PyOverloadTest::pure_test_ref(), test.T870_SubClassing_EnergyMethods2.CI1B_Method::residue_energy(), test.T860_SubClassing_EnergyMethods.MyCI1B_Method::residue_energy(), pyrosetta.toolbox::restrict_non_nbrs_from_repacking(), self-test::run_test(), and build::update_source_file().

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

Prints formatted data to stdout.

Example**::

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

References print().

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

Prints formatted data to the stream os.

Example**::

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

References fmt::BasicWriter< Char >::data(), fmt::BasicWriter< Char >::size(), numeric::statistics::w(), and fmt::BasicWriter< Char >::write().

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);

References print().

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

Prints formatted data to stdout.

Example**::

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

References fprintf().

Referenced by sprintf().

FMT_FUNC void fmt::report_system_error ( int  error_code,
fmt::StringRef  message 
)
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);

References printf(), fmt::BasicWriter< Char >::str(), and numeric::statistics::w().

Referenced by correlation(), PerformanceBenchmark::getOneReport(), PerformanceBenchmark::getReport(), and statistics().

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

Variable Documentation

FMT_GCC_EXTENSION typedef long long fmt::LongLong

Referenced by fmt::File::size().

FMT_GCC_EXTENSION typedef unsigned long long fmt::ULongLong