WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
basic_format_args< Context > Class Template Reference

A view of a collection of formatting arguments. More...

#include <fmt/base.h>

Public Types

using format_arg = basic_format_arg<Context>
 

Public Member Functions

constexpr basic_format_args ()
 
template<int NUM_ARGS, int NUM_NAMED_ARGS, unsigned long long DESC, FMT_ENABLE_IF(NUM_ARGS<=detail::max_packed_args) >
constexpr FMT_ALWAYS_INLINE basic_format_args (const store< NUM_ARGS, NUM_NAMED_ARGS, DESC > &s)
 Constructs a basic_format_args object from format_arg_store.
 
template<int NUM_ARGS, int NUM_NAMED_ARGS, unsigned long long DESC, FMT_ENABLE_IF(NUM_ARGS > detail::max_packed_args) >
constexpr basic_format_args (const store< NUM_ARGS, NUM_NAMED_ARGS, DESC > &s)
 
constexpr basic_format_args (const format_arg *args, int count, bool has_named=false)
 Constructs a basic_format_args object from a dynamic list of arguments.
 
FMT_CONSTEXPR auto get (int id) const -> format_arg
 Returns the argument with the specified id.
 
template<typename Char >
auto get (basic_string_view< Char > name) const -> format_arg
 
template<typename Char >
FMT_CONSTEXPR auto get_id (basic_string_view< Char > name) const -> int
 
auto max_size () const -> int
 

Detailed Description

template<typename Context>
class basic_format_args< Context >

A view of a collection of formatting arguments.

To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat:

void vlog(fmt::string_view fmt, fmt::format_args args);  // OK
fmt::format_args args = fmt::make_format_args();  // Dangling reference

Member Typedef Documentation

◆ format_arg

template<typename Context >
using basic_format_args< Context >::format_arg = basic_format_arg<Context>

Constructor & Destructor Documentation

◆ basic_format_args() [1/4]

template<typename Context >
basic_format_args< Context >::basic_format_args ( )
inlineconstexpr

◆ basic_format_args() [2/4]

template<typename Context >
template<int NUM_ARGS, int NUM_NAMED_ARGS, unsigned long long DESC, FMT_ENABLE_IF(NUM_ARGS<=detail::max_packed_args) >
FMT_ALWAYS_INLINE basic_format_args< Context >::basic_format_args ( const store< NUM_ARGS, NUM_NAMED_ARGS, DESC > & s)
inlineconstexpr

Constructs a basic_format_args object from format_arg_store.

◆ basic_format_args() [3/4]

template<typename Context >
template<int NUM_ARGS, int NUM_NAMED_ARGS, unsigned long long DESC, FMT_ENABLE_IF(NUM_ARGS > detail::max_packed_args) >
basic_format_args< Context >::basic_format_args ( const store< NUM_ARGS, NUM_NAMED_ARGS, DESC > & s)
inlineconstexpr

◆ basic_format_args() [4/4]

template<typename Context >
basic_format_args< Context >::basic_format_args ( const format_arg * args,
int count,
bool has_named = false )
inlineconstexpr

Constructs a basic_format_args object from a dynamic list of arguments.

Member Function Documentation

◆ get() [1/2]

template<typename Context >
template<typename Char >
auto basic_format_args< Context >::get ( basic_string_view< Char > name) const -> format_arg
inline

◆ get() [2/2]

template<typename Context >
FMT_CONSTEXPR auto basic_format_args< Context >::get ( int id) const -> format_arg
inline

Returns the argument with the specified id.

◆ get_id()

template<typename Context >
template<typename Char >
FMT_CONSTEXPR auto basic_format_args< Context >::get_id ( basic_string_view< Char > name) const -> int
inline

◆ max_size()

template<typename Context >
auto basic_format_args< Context >::max_size ( ) const -> int
inline

Member Data Documentation

◆ args_

template<typename Context >
const basic_format_arg<Context>* basic_format_args< Context >::args_

◆ values_

template<typename Context >
const detail::value<Context>* basic_format_args< Context >::values_

The documentation for this class was generated from the following file: