Go to the source code of this file.
Classes | |
struct | int_checker< IsSigned > |
struct | int_checker< true > |
class | printf_precision_handler |
class | is_zero_int |
struct | make_unsigned_or_bool< T > |
struct | make_unsigned_or_bool< bool > |
class | arg_converter< T, Context > |
class | char_converter< Context > |
class | printf_width_handler< Char > |
class | printf_arg_formatter< Range > |
class | basic_printf_context< OutputIt, Char > |
class | printf_arg_formatter< Range > |
struct | printf_formatter< T > |
class | basic_printf_context< OutputIt, Char > |
Namespaces | |
internal | |
Typedefs | |
template<typename Char > | |
using | basic_printf_context_t = basic_printf_context< std::back_insert_iterator< internal::buffer< 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 | convert_arg (basic_format_arg< Context > &arg, Char type) |
template<typename Char , typename Context > | |
void | printf (buffer< Char > &buf, basic_string_view< Char > format, basic_format_args< Context > args) |
template<typename OutputIt , typename Char , typename Context > | |
internal::truncating_iterator< OutputIt > | printf (internal::truncating_iterator< OutputIt > it, 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< Char >> args) |
template<typename S , typename... Args, typename Char = enable_if_t<internal::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< Char >> args) |
template<typename S , typename... Args, typename Char = enable_if_t<internal::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< Char >> args) |
template<typename S , typename... Args, FMT_ENABLE_IF(internal::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< Char >> args) |
template<typename ArgFormatter , typename Char , typename Context = basic_printf_context<typename ArgFormatter::iterator, Char>> | |
ArgFormatter::iterator | vprintf (internal::buffer< Char > &out, basic_string_view< Char > format_str, basic_format_args< 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) |
using basic_printf_context_t = basic_printf_context<std::back_insert_iterator<internal::buffer<Char> >, Char> |
using printf_args = basic_format_args<printf_context> |
using printf_context = basic_printf_context_t<char> |
using wprintf_args = basic_format_args<wprintf_context> |
using wprintf_context = basic_printf_context_t<wchar_t> |
int fprintf | ( | std::FILE * | f, |
const S & | format, | ||
const Args &... | args | ||
) |
Prints formatted data to the file f.
Example**::
fmt::fprintf(stderr, "Don't %s!", "panic");
Definition at line 643 of file printf.h.
References internal::to_string_view(), and vfprintf().
int fprintf | ( | std::basic_ostream< Char > & | os, |
const S & | format_str, | ||
const Args &... | args | ||
) |
Prints formatted data to the stream os.
Example**::
fmt::fprintf(cerr, "Don't %s!", "panic");
Definition at line 703 of file printf.h.
References FMT_END_NAMESPACE, internal::to_string_view(), and vfprintf().
format_arg_store<printf_context, Args...> make_printf_args | ( | const Args &... | args | ) |
Constructs an ~fmtformat_arg_store
object that contains references to arguments and can be implicitly converted to ~fmtprintf_args
.
format_arg_store<wprintf_context, Args...> make_wprintf_args | ( | const Args &... | args | ) |
Constructs an ~fmtformat_arg_store
object that contains references to arguments and can be implicitly converted to ~fmtwprintf_args
.
int printf | ( | const S & | format_str, |
const Args &... | args | ||
) |
Prints formatted data to stdout
.
Example**::
fmt::printf("Elapsed time: %.2f seconds", 1.23);
Definition at line 666 of file printf.h.
References internal::to_string_view(), and vprintf().
Referenced by StableSum< double >::operator double().
std::basic_string<Char> sprintf | ( | const S & | format, |
const Args &... | args | ||
) |
Formats arguments and returns the result as a string.
Example**::
std::string message = fmt::sprintf("The answer is %d", 42);
Definition at line 616 of file printf.h.
References internal::to_string_view(), and vsprintf().
int vfprintf | ( | std::FILE * | f, |
const S & | format, | ||
basic_format_args< basic_printf_context_t< Char >> | args | ||
) |
Definition at line 622 of file printf.h.
References buffer< T >::data(), internal::printf(), buffer< T >::size(), and internal::to_string_view().
int vfprintf | ( | std::basic_ostream< Char > & | os, |
const S & | format, | ||
basic_format_args< basic_printf_context_t< Char >> | args | ||
) |
Definition at line 673 of file printf.h.
References internal::printf(), buffer< T >::size(), internal::to_string_view(), and internal::write().
int vprintf | ( | const S & | format, |
basic_format_args< basic_printf_context_t< Char >> | args | ||
) |
Definition at line 650 of file printf.h.
References FMT_ENABLE_IF, internal::to_string_view(), and vfprintf().
Referenced by printf().
ArgFormatter::iterator vprintf | ( | internal::buffer< Char > & | out, |
basic_string_view< Char > | format_str, | ||
basic_format_args< Context > | args | ||
) |
std::basic_string<Char> vsprintf | ( | const S & | format, |
basic_format_args< basic_printf_context_t< Char >> | args | ||
) |
Definition at line 598 of file printf.h.
References internal::printf(), to_string(), and internal::to_string_view().
Referenced by sprintf().