HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
printf.h File Reference
#include <algorithm>
#include <limits>
#include <ostream>
#include "format.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  printf_formatter< T >
 
class  basic_printf_parse_context< Char >
 
class  basic_printf_context< OutputIt, Char >
 
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 >
 
struct  get_cstring< Char >
 
class  printf_width_handler< Char >
 
class  printf_arg_formatter< OutputIt, Char >
 

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 convert_arg (basic_format_arg< Context > &arg, Char type)
 
template<typename Char >
void parse_flags (basic_format_specs< Char > &specs, const Char *&it, const Char *end)
 
template<typename Char , typename GetArg >
int parse_header (const Char *&it, const Char *end, basic_format_specs< Char > &specs, GetArg get_arg)
 
template<typename Char , typename Context >
void vprintf (buffer< Char > &buf, basic_string_view< Char > format, basic_format_args< Context > args)
 
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 S , typename Char = char_t<S>>
auto vsprintf (const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> std::basic_string< Char >
 
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 S , typename Char = char_t<S>>
auto vfprintf (std::FILE *f, const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> int
 
template<typename S , typename... T, typename Char = char_t<S>>
auto fprintf (std::FILE *f, const S &fmt, const T &...args) -> int
 
template<typename S , typename Char = char_t<S>>
auto vprintf (const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> int
 
template<typename S , typename... T, FMT_ENABLE_IF(detail::is_string< S >::value) >
auto printf (const S &fmt, const T &...args) -> int
 
template<typename S , typename Char = char_t<S>>
FMT_DEPRECATED auto vfprintf (std::basic_ostream< Char > &os, const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> int
 
template<typename S , typename... T, typename Char = char_t<S>>
FMT_DEPRECATED auto fprintf (std::basic_ostream< Char > &os, const S &fmt, const T &...args) -> int
 

Typedef Documentation

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

Definition at line 521 of file printf.h.

Definition at line 526 of file printf.h.

Definition at line 523 of file printf.h.

Definition at line 527 of file printf.h.

Definition at line 524 of file printf.h.

Function Documentation

template<typename T , typename Context , typename Char >
void convert_arg ( basic_format_arg< Context > &  arg,
Char  type 
)

Definition at line 165 of file printf.h.

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

Definition at line 643 of file printf.h.

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

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

Definition at line 536 of file printf.h.

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

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

Definition at line 548 of file printf.h.

template<typename Char >
void parse_flags ( basic_format_specs< Char > &  specs,
const Char *&  it,
const Char *  end 
)

Definition at line 302 of file printf.h.

template<typename Char , typename GetArg >
int parse_header ( const Char *&  it,
const Char *  end,
basic_format_specs< Char > &  specs,
GetArg  get_arg 
)

Definition at line 330 of file printf.h.

template<typename S , typename... T, FMT_ENABLE_IF(detail::is_string< S >::value) >
auto printf ( const S &  fmt,
const T &...  args 
) -> int
inline

Prints formatted data to stdout.

Example**::

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

Examples:
CVEX/cvexsample.C, CVEX/simple.C, CVEX/test.vfl, packedsphere/packedsphere.C, standalone/dsmprint.C, standalone/i3dsphere.C, ui/cmd_ui.C, VEX/VEX_Example.C, and VEX/VEX_Sort.vfl.

Definition at line 626 of file printf.h.

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

Formats arguments and returns the result as a string.

Example**::

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

Definition at line 574 of file printf.h.

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

Definition at line 580 of file printf.h.

template<typename S , typename Char = char_t<S>>
FMT_DEPRECATED auto vfprintf ( std::basic_ostream< Char > &  os,
const S &  fmt,
basic_format_args< basic_printf_context_t< type_identity_t< Char >>>  args 
) -> int

Definition at line 633 of file printf.h.

template<typename Char , typename Context >
void vprintf ( buffer< Char > &  buf,
basic_string_view< Char >  format,
basic_format_args< Context >  args 
)

Definition at line 368 of file printf.h.

template<typename S , typename Char = char_t<S>>
auto vprintf ( const S &  fmt,
basic_format_args< basic_printf_context_t< type_identity_t< Char >>>  args 
) -> int
inline

Definition at line 609 of file printf.h.

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

Definition at line 554 of file printf.h.