HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
printf.h File Reference
#include <algorithm>
#include <limits>
#include "ostream.h"
+ Include dependency graph for printf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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  basic_printf_context< OutputIt, 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

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

Definition at line 601 of file printf.h.

Definition at line 606 of file printf.h.

Definition at line 603 of file printf.h.

Definition at line 607 of file printf.h.

Definition at line 604 of file printf.h.

Function Documentation

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

Prints formatted data to the stream os.

Example**::

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

Definition at line 743 of file printf.h.

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

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

Definition at line 616 of file printf.h.

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

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

Definition at line 628 of file printf.h.

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 S , typename... Args, FMT_ENABLE_IF(detail::is_string< S >::value) >
int printf ( const S &  format_str,
const Args &...  args 
)
inline

Prints formatted data to stdout.

Example**::

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

Definition at line 705 of file printf.h.

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

Formats arguments and returns the result as a string.

Example**::

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

Definition at line 653 of file printf.h.

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

Definition at line 659 of file printf.h.

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

Definition at line 712 of file printf.h.

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

Definition at line 688 of file printf.h.

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.

Definition at line 725 of file printf.h.

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

Definition at line 634 of file printf.h.