Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
printf_arg_formatter< Range > Class Template Reference
Inheritance diagram for printf_arg_formatter< Range >:
Collaboration diagram for printf_arg_formatter< Range >:

Public Types

using iterator = typename Range::iterator
using format_specs = typename base::format_specs
Public Types inherited from internal::arg_formatter_base< Range, ErrorHandler >
using char_type = typename Range::value_type
using iterator = typename Range::iterator
using format_specs = basic_format_specs<char_type>

Public Member Functions

 printf_arg_formatter (iterator iter, format_specs &specs, context_type &ctx)
template<typename T, FMT_ENABLE_IF(duckdb_fmt::internal::is_integral< T >::value)>
iterator operator() (T value)
template<typename T, FMT_ENABLE_IF(std::is_floating_point< T >::value)>
iterator operator() (T value)
iterator operator() (const char *value)
iterator operator() (const wchar_t *value)
iterator operator() (basic_string_view< char_type > value)
iterator operator() (monostate value)
iterator operator() (const void *value)
iterator operator() (typename basic_format_arg< context_type >::handle handle)
Public Member Functions inherited from internal::arg_formatter_base< Range, ErrorHandler >
 arg_formatter_base (Range r, format_specs *s, locale_ref loc)
iterator operator() (monostate)
template<typename T, FMT_ENABLE_IF(is_integral< T >::value)>
iterator operator() (T value)
iterator operator() (char_type value)
iterator operator() (bool value)
template<typename T, FMT_ENABLE_IF(std::is_floating_point< T >::value)>
iterator operator() (T value)
iterator operator() (const char_type *value)
iterator operator() (basic_string_view< char_type > value)
iterator operator() (const void *value)

Private Types

using char_type = typename Range::value_type
using base = internal::arg_formatter_base<Range>
using context_type = basic_printf_context<iterator, char_type>

Private Member Functions

void write_null_pointer (char)
void write_null_pointer (wchar_t)

Private Attributes

context_type & context_

Additional Inherited Members

Protected Member Functions inherited from internal::arg_formatter_base< Range, ErrorHandler >
writer_type & writer ()
FMT_DEPRECATED format_specs * spec ()
format_specs * specs ()
iterator out ()
void write (bool value)
void write (const char_type *value)

Detailed Description

template<typename Range>
class printf_arg_formatter< Range >

\rst The printf argument formatter. \endrst

Constructor & Destructor Documentation

◆ printf_arg_formatter()

template<typename Range>
printf_arg_formatter< Range >::printf_arg_formatter ( iterator iter,
format_specs & specs,
context_type & ctx )
inline

\rst Constructs an argument formatter object. buffer* is a reference to the output buffer and specs contains format specifier information for standard argument types. \endrst

71390 : base(Range(iter), &specs, internal::locale_ref()), context_(ctx) {}
Definition duckdb.cpp:71358

Member Function Documentation

◆ write_null_pointer() [1/2]

template<typename Range>
void printf_arg_formatter< Range >::write_null_pointer ( char )
inlineprivate
71369 {
71370 this->specs()->type = 0;
71371 this->write("(nil)");
71372 }

◆ write_null_pointer() [2/2]

template<typename Range>
void printf_arg_formatter< Range >::write_null_pointer ( wchar_t )
inlineprivate
71374 {
71375 this->specs()->type = 0;
71376 this->write(L"(nil)");
71377 }

◆ operator()() [1/8]

template<typename Range>
template<typename T, FMT_ENABLE_IF(duckdb_fmt::internal::is_integral< T >::value)>
iterator printf_arg_formatter< Range >::operator() ( T value)
inline
71393 {
71394 // MSVC2013 fails to compile separate overloads for bool and char_type so
71395 // use std::is_same instead.
71397 format_specs& fmt_specs = *this->specs();
71398 if (fmt_specs.type != 's') return base::operator()(value ? 1 : 0);
71399 fmt_specs.type = 0;
71400 this->write(value != 0);
71402 format_specs& fmt_specs = *this->specs();
71403 if (fmt_specs.type && fmt_specs.type != 'c')
71404 return (*this)(static_cast<int>(value));
71405 fmt_specs.sign = sign::none;
71406 fmt_specs.alt = false;
71407 fmt_specs.align = align::right;
71408 return base::operator()(value);
71409 } else {
71410 return base::operator()(value);
71411 }
71412 return this->out();
71413 }

◆ operator()() [2/8]

template<typename Range>
template<typename T, FMT_ENABLE_IF(std::is_floating_point< T >::value)>
iterator printf_arg_formatter< Range >::operator() ( T value)
inline
71416 {
71417 return base::operator()(value);
71418 }

◆ operator()() [3/8]

template<typename Range>
iterator printf_arg_formatter< Range >::operator() ( const char * value)
inline

Formats a null-terminated C string.

71421 {
71422 if (value)
71423 base::operator()(value);
71424 else if (this->specs()->type == 'p')
71425 write_null_pointer(char_type());
71426 else
71427 this->write("(null)");
71428 return this->out();
71429 }

◆ operator()() [4/8]

template<typename Range>
iterator printf_arg_formatter< Range >::operator() ( const wchar_t * value)
inline

Formats a null-terminated wide C string.

71432 {
71433 if (value)
71434 base::operator()(value);
71435 else if (this->specs()->type == 'p')
71436 write_null_pointer(char_type());
71437 else
71438 this->write(L"(null)");
71439 return this->out();
71440 }

◆ operator()() [5/8]

template<typename Range>
iterator printf_arg_formatter< Range >::operator() ( basic_string_view< char_type > value)
inline
71442 {
71443 return base::operator()(value);
71444 }

◆ operator()() [6/8]

template<typename Range>
iterator printf_arg_formatter< Range >::operator() ( monostate value)
inline
71446{ return base::operator()(value); }

◆ operator()() [7/8]

template<typename Range>
iterator printf_arg_formatter< Range >::operator() ( const void * value)
inline

Formats a pointer.

71449 {
71450 if (value) return base::operator()(value);
71451 this->specs()->type = 0;
71452 write_null_pointer(char_type());
71453 return this->out();
71454 }

◆ operator()() [8/8]

template<typename Range>
iterator printf_arg_formatter< Range >::operator() ( typename basic_format_arg< context_type >::handle handle)
inline

Formats an argument of a custom (user-defined) type.

71457 {
71458 handle.format(context_.parse_context(), context_);
71459 return this->out();
71460 }

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