Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
basic_format_args< Context > Class Template Reference

#include <core.h>

Public Types

using format_arg = basic_format_arg< Context >
 
using size_type = int
 

Public Member Functions

constexpr basic_format_args ()
 
constexpr FMT_INLINE basic_format_args (const dynamic_format_arg_store< Context > &store)
 
constexpr basic_format_args (const format_arg *args, int count)
 
template<typename... Args>
constexpr FMT_INLINE basic_format_args (const format_arg_store< Context, Args... > &store)
 
template<typename Char >
auto get (basic_string_view< Char > name) const -> format_arg
 
FMT_CONSTEXPR auto get (int id) const -> format_arg
 
template<typename Char >
auto get_id (basic_string_view< Char > name) const -> int
 
auto max_size () const -> int
 

Private Member Functions

constexpr FMT_INLINE basic_format_args (unsigned long long desc, const detail::value< Context > *values)
 
constexpr basic_format_args (unsigned long long desc, const format_arg *args)
 
auto has_named_args () const -> bool
 
constexpr auto is_packed () const -> bool
 
FMT_CONSTEXPR auto type (int index) const -> detail::type
 

Private Attributes

union {
   const format_arg *   args_
 
   const detail::value< Context > *   values_
 
}; 
 
unsigned long long desc_
 

Detailed Description

template<typename Context>
class basic_format_args< Context >

\rst 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(string_view format_str, format_args args); // OK format_args args = make_format_args(); // Error: dangling reference \endrst

Definition at line 1081 of file core.h.

Member Typedef Documentation

◆ format_arg

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

Definition at line 1894 of file core.h.

◆ size_type

template<typename Context >
using basic_format_args< Context >::size_type = int

Definition at line 1893 of file core.h.

Constructor & Destructor Documentation

◆ basic_format_args() [1/6]

template<typename Context >
constexpr FMT_INLINE basic_format_args< Context >::basic_format_args ( unsigned long long  desc,
const detail::value< Context > *  values 
)
inlineconstexprprivate

Definition at line 1925 of file core.h.

◆ basic_format_args() [2/6]

template<typename Context >
constexpr basic_format_args< Context >::basic_format_args ( unsigned long long  desc,
const format_arg args 
)
inlineconstexprprivate

Definition at line 1928 of file core.h.

◆ basic_format_args() [3/6]

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

Definition at line 1932 of file core.h.

◆ basic_format_args() [4/6]

template<typename Context >
template<typename... Args>
constexpr FMT_INLINE basic_format_args< Context >::basic_format_args ( const format_arg_store< Context, Args... > &  store)
inlineconstexpr

\rst Constructs a basic_format_args object from ~fmtformat_arg_store. \endrst

Definition at line 1940 of file core.h.

◆ basic_format_args() [5/6]

template<typename Context >
constexpr FMT_INLINE basic_format_args< Context >::basic_format_args ( const dynamic_format_arg_store< Context > &  store)
inlineconstexpr

\rst Constructs a basic_format_args object from ~fmtdynamic_format_arg_store. \endrst

Definition at line 1951 of file core.h.

◆ basic_format_args() [6/6]

template<typename Context >
constexpr basic_format_args< Context >::basic_format_args ( const format_arg args,
int  count 
)
inlineconstexpr

\rst Constructs a basic_format_args object from a dynamic set of arguments. \endrst

Definition at line 1960 of file core.h.

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

Definition at line 1979 of file core.h.

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

Definition at line 1965 of file core.h.

◆ get_id()

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

Definition at line 1985 of file core.h.

◆ has_named_args()

template<typename Context >
auto basic_format_args< Context >::has_named_args ( ) const -> bool
inlineprivate

Definition at line 1915 of file core.h.

◆ is_packed()

template<typename Context >
constexpr auto basic_format_args< Context >::is_packed ( ) const -> bool
inlineconstexprprivate

Definition at line 1912 of file core.h.

◆ max_size()

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

Definition at line 1995 of file core.h.

◆ type()

template<typename Context >
FMT_CONSTEXPR auto basic_format_args< Context >::type ( int  index) const -> detail::type
inlineprivate

Definition at line 1919 of file core.h.

Member Data Documentation

◆ @49

union { ... }

◆ args_

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

Definition at line 1909 of file core.h.

◆ desc_

template<typename Context >
unsigned long long basic_format_args< Context >::desc_
private

Definition at line 1901 of file core.h.

◆ values_

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

Definition at line 1908 of file core.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:28