WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
printf.h File Reference
#include <algorithm>
#include <limits>
#include "format.h"

Go to the source code of this file.

Classes

struct  printf_formatter< T >
 
class  basic_printf_context< Char >
 
struct  detail::int_checker< IsSigned >
 
struct  detail::int_checker< true >
 
struct  detail::printf_precision_handler
 
struct  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
 
class  detail::printf_arg_formatter< Char >
 
struct  vprintf_args< Char >
 

Namespaces

namespace  detail
 detail namespace with internal helper functions
 

Typedefs

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

Functions

template<bool IS_CONSTEXPR, typename T , typename Ptr = const T*>
FMT_CONSTEXPR auto detail::find (Ptr first, Ptr last, T value, Ptr &out) -> bool
 
template<>
auto detail::find< false, char > (const char *first, const char *last, char value, const char *&out) -> bool
 
template<typename T , typename Context , typename Char >
void detail::convert_arg (basic_format_arg< Context > &arg, Char type)
 
template<typename Char >
auto detail::make_arg_formatter (basic_appender< Char > iter, format_specs &s) -> arg_formatter< Char >
 
template<typename Char >
void detail::parse_flags (format_specs &specs, const Char *&it, const Char *end)
 
template<typename Char , typename GetArg >
auto detail::parse_header (const Char *&it, const Char *end, format_specs &specs, GetArg get_arg) -> int
 
auto detail::parse_printf_presentation_type (char c, type t, bool &upper) -> presentation_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 = char, typename... T>
auto make_printf_args (T &... args) -> decltype(fmt::make_format_args< basic_printf_context< Char > >(args...))
 Constructs an format_arg_store object that contains references to arguments and can be implicitly converted to printf_args.
 
template<typename Char >
auto vsprintf (basic_string_view< Char > fmt, typename vprintf_args< Char >::type args) -> std::basic_string< Char >
 
template<typename S , typename... T, typename Char = detail::char_t<S>>
auto sprintf (const S &fmt, const T &... args) -> std::basic_string< Char >
 Formats args according to specifications in fmt and returns the result as as string.
 
template<typename Char >
auto vfprintf (std::FILE *f, basic_string_view< Char > fmt, typename vprintf_args< Char >::type args) -> int
 
template<typename S , typename... T, typename Char = detail::char_t<S>>
auto fprintf (std::FILE *f, const S &fmt, const T &... args) -> int
 Formats args according to specifications in fmt and writes the output to f.
 
template<typename Char >
FMT_DEPRECATED auto vprintf (basic_string_view< Char > fmt, typename vprintf_args< Char >::type args) -> int
 
template<typename... T>
auto printf (string_view fmt, const T &... args) -> int
 Formats args according to specifications in fmt and writes the output to stdout.
 
template<typename... T>
FMT_DEPRECATED auto printf (basic_string_view< wchar_t > fmt, const T &... args) -> int
 

Typedef Documentation

◆ printf_args

◆ printf_context

◆ wprintf_args

◆ wprintf_context

Function Documentation

◆ fprintf()

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

Formats args according to specifications in fmt and writes the output to f.

Example:

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

◆ make_printf_args()

template<typename Char = char, typename... T>
auto make_printf_args ( T &... args) -> decltype(fmt::make_format_args<basic_printf_context<Char>>(args...))
inline

Constructs an format_arg_store object that contains references to arguments and can be implicitly converted to printf_args.

◆ printf() [1/2]

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

◆ printf() [2/2]

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

Formats args according to specifications in fmt and writes the output to stdout.

Example:

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

◆ sprintf()

template<typename S , typename... T, typename Char = detail::char_t<S>>
auto sprintf ( const S & fmt,
const T &... args ) -> std::basic_string<Char>
inline

Formats args according to specifications in fmt and returns the result as as string.

Example:

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

◆ vfprintf()

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

◆ vprintf()

template<typename Char >
FMT_DEPRECATED auto vprintf ( basic_string_view< Char > fmt,
typename vprintf_args< Char >::type args ) -> int
inline

◆ vsprintf()

template<typename Char >
auto vsprintf ( basic_string_view< Char > fmt,
typename vprintf_args< Char >::type args ) -> std::basic_string<Char>
inline