Rosetta
Classes | Namespaces | Typedefs | Functions
printf.h File Reference
#include <algorithm>
#include <limits>
#include "ostream.h"

Classes

struct  detail::int_checker< IsSigned >
 
struct  detail::int_checker< true >
 
class  detail::printf_precision_handler
 
class  detail::is_zero_int
 
struct  detail::make_unsigned_or_bool< T >
 
struct  detail::make_unsigned_or_bool< bool >
 
class  detail::arg_converter< T, Context >
 
class  detail::char_converter< Context >
 
struct  detail::get_cstring< Char >
 
class  detail::printf_width_handler< Char >
 
class  basic_printf_parse_context< Char >
 
class  printf_arg_formatter< OutputIt, Char >
 
struct  printf_formatter< T >
 
class  basic_printf_context< OutputIt, Char >
 

Namespaces

 detail
 

Typedefs

template<typename Char >
using basic_printf_context_t = basic_printf_context< detail::buffer_appender< Char >, Char >
 
using printf_context = basic_printf_context_t< char >
 
using wprintf_context = basic_printf_context_t< wchar_t >
 
using printf_args = basic_format_args< printf_context >
 
using wprintf_args = basic_format_args< wprintf_context >
 

Functions

template<typename T , typename Context , typename Char >
void detail::convert_arg (basic_format_arg< Context > &arg, Char type)
 
template<typename Char , typename Context >
void detail::vprintf (buffer< Char > &buf, basic_string_view< Char > format, basic_format_args< Context > args)
 
template<typename Char , typename Context >
FMT_DEPRECATED void printf (detail::buffer< Char > &buf, basic_string_view< Char > format, basic_format_args< Context > args)
 
template<typename... Args>
format_arg_store< printf_context, Args... > make_printf_args (const Args &... args)
 
template<typename... Args>
format_arg_store< wprintf_context, Args... > make_wprintf_args (const Args &... args)
 
template<typename S , typename Char = char_t<S>>
std::basic_string< Char > vsprintf (const S &format, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args)
 
template<typename S , typename... Args, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
std::basic_string< Char > sprintf (const S &format, const Args &... args)
 
template<typename S , typename Char = char_t<S>>
int vfprintf (std::FILE *f, const S &format, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args)
 
template<typename S , typename... Args, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
int fprintf (std::FILE *f, const S &format, const Args &... args)
 
template<typename S , typename Char = char_t<S>>
int vprintf (const S &format, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args)
 
template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_string< S >::value) >
int printf (const S &format_str, const Args &... args)
 
template<typename S , typename Char = char_t<S>>
int vfprintf (std::basic_ostream< Char > &os, const S &format, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args)
 
template<typename ArgFormatter , typename Char , typename Context = basic_printf_context<typename ArgFormatter::iterator, Char>>
ArgFormatter::iterator vprintf (detail::buffer< Char > &out, basic_string_view< Char > format_str, basic_format_args< type_identity_t< Context >> args)
 
template<typename S , typename... Args, typename Char = char_t<S>>
int fprintf (std::basic_ostream< Char > &os, const S &format_str, const Args &... args)
 

Typedef Documentation

◆ basic_printf_context_t

template<typename Char >
using basic_printf_context_t = basic_printf_context<detail::buffer_appender<Char>, Char>

◆ printf_args

◆ printf_context

◆ wprintf_args

◆ wprintf_context

Function Documentation

◆ fprintf() [1/2]

template<typename S , typename... Args, typename Char = char_t<S>>
int fprintf ( std::basic_ostream< Char > &  os,
const S format_str,
const Args &...  args 
)
inline

\rst Prints formatted data to the stream os.

Example**::

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

References find_lowest_scoring_relaxed_struct::args, to_string_view(), and vfprintf().

◆ fprintf() [2/2]

template<typename S , typename... Args, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
int fprintf ( std::FILE *  f,
const S format,
const Args &...  args 
)
inline

\rst Prints formatted data to the file f.

Example**::

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

References find_lowest_scoring_relaxed_struct::args, create_a3b_hbs::f, pyrosetta.tests.distributed.test_dask::format, to_string_view(), and vfprintf().

◆ make_printf_args()

template<typename... Args>
format_arg_store<printf_context, Args...> make_printf_args ( const Args &...  args)
inline

\rst Constructs an ~fmtformat_arg_store object that contains references to arguments and can be implicitly converted to ~fmtprintf_args. \endrst

References find_lowest_scoring_relaxed_struct::args.

◆ make_wprintf_args()

template<typename... Args>
format_arg_store<wprintf_context, Args...> make_wprintf_args ( const Args &...  args)
inline

\rst Constructs an ~fmtformat_arg_store object that contains references to arguments and can be implicitly converted to ~fmtwprintf_args. \endrst

References find_lowest_scoring_relaxed_struct::args.

◆ printf() [1/2]

template<typename S , typename... Args, FMT_ENABLE_IF(detail::is_string< S >::value) >
int printf ( const S format_str,
const Args &...  args 
)
inline

\rst Prints formatted data to stdout.

Example**::

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

References find_lowest_scoring_relaxed_struct::args, to_string_view(), and vprintf().

◆ printf() [2/2]

template<typename Char , typename Context >
FMT_DEPRECATED void printf ( detail::buffer< Char > &  buf,
basic_string_view< Char >  format,
basic_format_args< Context >  args 
)

◆ sprintf()

template<typename S , typename... Args, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
std::basic_string<Char> sprintf ( const S format,
const Args &...  args 
)
inline

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

Example**::

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

References find_lowest_scoring_relaxed_struct::args, pyrosetta.tests.distributed.test_dask::format, to_string_view(), and vsprintf().

◆ vfprintf() [1/2]

template<typename S , typename Char = char_t<S>>
int vfprintf ( std::basic_ostream< Char > &  os,
const S format,
basic_format_args< basic_printf_context_t< type_identity_t< Char >>>  args 
)
inline

◆ vfprintf() [2/2]

template<typename S , typename Char = char_t<S>>
int vfprintf ( std::FILE *  f,
const S format,
basic_format_args< basic_printf_context_t< type_identity_t< Char >>>  args 
)
inline

◆ vprintf() [1/2]

template<typename S , typename Char = char_t<S>>
int vprintf ( const S format,
basic_format_args< basic_printf_context_t< type_identity_t< Char >>>  args 
)
inline

◆ vprintf() [2/2]

template<typename ArgFormatter , typename Char , typename Context = basic_printf_context<typename ArgFormatter::iterator, Char>>
ArgFormatter::iterator vprintf ( detail::buffer< Char > &  out,
basic_string_view< Char >  format_str,
basic_format_args< type_identity_t< Context >>  args 
)

Formats arguments and writes the output to the range.

References find_lowest_scoring_relaxed_struct::args, and subloop_histogram::iterator.

◆ vsprintf()

template<typename S , typename Char = char_t<S>>
std::basic_string<Char> vsprintf ( const S format,
basic_format_args< basic_printf_context_t< type_identity_t< Char >>>  args 
)
inline