Classes | Namespaces | Typedefs | Functions
printf.h File Reference
#include <algorithm>
#include <limits>
#include "format.h"
Include dependency graph for printf.h:

Go to the source code of this file.

Classes

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

Namespaces

 detail
 

Typedefs

using printf_args = basic_format_args< printf_context >
 
using printf_context = basic_printf_context< char >
 
using wprintf_args = basic_format_args< wprintf_context >
 
using wprintf_context = basic_printf_context< wchar_t >
 

Functions

template<typename T , typename Context , typename Char >
void detail::convert_arg (basic_format_arg< Context > &arg, Char type)
 
template<typename S , typename... T, typename Char = char_t<S>>
auto fprintf (std::FILE *f, const S &fmt, const T &... args) -> int
 
template<typename Char >
auto detail::make_arg_formatter (buffer_appender< Char > iter, format_specs< Char > &s) -> arg_formatter< Char >
 
template<typename... T>
auto make_printf_args (const T &... args) -> format_arg_store< printf_context, T... >
 
template<typename... T>
auto make_wprintf_args (const T &... args) -> format_arg_store< wprintf_context, T... >
 
template<typename Char >
void detail::parse_flags (format_specs< Char > &specs, const Char *&it, const Char *end)
 
template<typename Char , typename GetArg >
auto detail::parse_header (const Char *&it, const Char *end, format_specs< Char > &specs, GetArg get_arg) -> int
 
auto detail::parse_printf_presentation_type (char c, type t) -> presentation_type
 
template<typename... T>
FMT_DEPRECATED auto printf (basic_string_view< wchar_t > fmt, const T &... args) -> int
 
template<typename... T>
auto printf (string_view fmt, const T &... args) -> int
 
template<typename S , typename... T, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
auto sprintf (const S &fmt, const T &... args) -> std::basic_string< Char >
 
template<typename Char >
auto vfprintf (std::FILE *f, basic_string_view< Char > fmt, basic_format_args< basic_printf_context< type_identity_t< Char >>> args) -> int
 
template<typename Char >
FMT_DEPRECATED auto vprintf (basic_string_view< Char > fmt, basic_format_args< basic_printf_context< type_identity_t< Char >>> args) -> int
 
template<typename Char , typename Context >
void detail::vprintf (buffer< Char > &buf, basic_string_view< Char > format, basic_format_args< Context > args)
 
template<typename Char >
auto vsprintf (basic_string_view< Char > fmt, basic_format_args< basic_printf_context< type_identity_t< Char >>> args) -> std::basic_string< Char >
 

Typedef Documentation

◆ printf_args

Definition at line 569 of file printf.h.

◆ printf_context

Definition at line 566 of file printf.h.

◆ wprintf_args

Definition at line 570 of file printf.h.

◆ wprintf_context

Definition at line 567 of file printf.h.

Function Documentation

◆ fprintf()

template<typename S , typename... T, typename Char = char_t<S>>
auto fprintf ( std::FILE *  f,
const S fmt,
const T &...  args 
) -> int
inline

\rst Prints formatted data to the file f.

Example**::

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

Definition at line 640 of file printf.h.

◆ make_printf_args()

template<typename... T>
auto make_printf_args ( const T &...  args) -> format_arg_store<printf_context, T...>
inline

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

Definition at line 579 of file printf.h.

◆ make_wprintf_args()

template<typename... T>
auto make_wprintf_args ( const T &...  args) -> format_arg_store<wprintf_context, T...>
inline

Definition at line 586 of file printf.h.

◆ printf() [1/2]

template<typename... T>
FMT_DEPRECATED auto printf ( basic_string_view< wchar_t >  fmt,
const T &...  args 
) -> int
inline

Definition at line 667 of file printf.h.

◆ printf() [2/2]

template<typename... T>
auto printf ( string_view  fmt,
const T &...  args 
) -> int
inline

\rst Prints formatted data to stdout.

Example**::

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

Definition at line 663 of file printf.h.

◆ sprintf()

template<typename S , typename... T, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
auto sprintf ( const S fmt,
const T &...  args 
) -> std::basic_string<Char>
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 612 of file printf.h.

◆ vfprintf()

template<typename Char >
auto vfprintf ( std::FILE *  f,
basic_string_view< Char >  fmt,
basic_format_args< basic_printf_context< type_identity_t< Char >>>  args 
) -> int
inline

Definition at line 618 of file printf.h.

◆ vprintf()

template<typename Char >
FMT_DEPRECATED auto vprintf ( basic_string_view< Char >  fmt,
basic_format_args< basic_printf_context< type_identity_t< Char >>>  args 
) -> int
inline

Definition at line 646 of file printf.h.

◆ vsprintf()

template<typename Char >
auto vsprintf ( basic_string_view< Char >  fmt,
basic_format_args< basic_printf_context< type_identity_t< Char >>>  args 
) -> std::basic_string<Char>
inline

Definition at line 592 of file printf.h.



plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49