Scippy

SoPlex

Sequential object-oriented simPlex

basic_printf_context< OutputIt, Char > Class Template Reference

#include <ostream.h>

Public Types

using char_type = Char
 
using iterator = OutputIt
 
using format_arg = basic_format_arg< basic_printf_context >
 
using parse_context_type = basic_printf_parse_context< Char >
 
template<typename T >
using formatter_type = printf_formatter< T >
 

Public Member Functions

 basic_printf_context (OutputIt out, basic_string_view< char_type > format_str, basic_format_args< basic_printf_context > args)
 
OutputIt out ()
 
void advance_to (OutputIt it)
 
detail::locale_ref locale ()
 
format_arg arg (int id) const
 
parse_context_typeparse_context ()
 
FMT_CONSTEXPR void on_error (const char *message)
 
template<typename ArgFormatter = printf_arg_formatter<OutputIt, Char>>
OutputIt format ()
 

Private Types

using format_specs = basic_format_specs< char_type >
 

Private Member Functions

format_arg get_arg (int arg_index=-1)
 
int parse_header (const Char *&it, const Char *end, format_specs &specs)
 

Static Private Member Functions

static void parse_flags (format_specs &specs, const Char *&it, const Char *end)
 

Private Attributes

OutputIt out_
 
basic_format_args< basic_printf_contextargs_
 
parse_context_type parse_ctx_
 

Detailed Description

template<typename OutputIt, typename Char>
class basic_printf_context< OutputIt, Char >

This template formats data and writes the output through an output iterator.

Definition at line 18 of file ostream.h.

Member Typedef Documentation

◆ char_type

using char_type = Char

The character type for the output.

Definition at line 339 of file printf.h.

◆ format_arg

Definition at line 341 of file printf.h.

◆ format_specs

Definition at line 346 of file printf.h.

◆ formatter_type

Definition at line 343 of file printf.h.

◆ iterator

using iterator = OutputIt

Definition at line 340 of file printf.h.

◆ parse_context_type

Definition at line 342 of file printf.h.

Constructor & Destructor Documentation

◆ basic_printf_context()

basic_printf_context ( OutputIt  out,
basic_string_view< char_type format_str,
basic_format_args< basic_printf_context< OutputIt, Char > >  args 
)

Constructs a printf_context object. References to the arguments are stored in the context object so make sure they have appropriate lifetimes.

Definition at line 369 of file printf.h.

Member Function Documentation

◆ advance_to()

void advance_to ( OutputIt  it)

Definition at line 374 of file printf.h.

◆ arg()

format_arg arg ( int  id) const

Definition at line 378 of file printf.h.

References basic_format_args< Context >::get().

◆ format()

◆ get_arg()

basic_printf_context< OutputIt, Char >::format_arg get_arg ( int  arg_index = -1)
private

Definition at line 422 of file printf.h.

References detail::get_arg().

◆ locale()

detail::locale_ref locale ( )

Definition at line 376 of file printf.h.

◆ on_error()

FMT_CONSTEXPR void on_error ( const char *  message)

◆ out()

OutputIt out ( )

Definition at line 373 of file printf.h.

◆ parse_context()

parse_context_type& parse_context ( )

Definition at line 380 of file printf.h.

Referenced by printf_arg_formatter< OutputIt, Char >::operator()().

◆ parse_flags()

void parse_flags ( format_specs specs,
const Char *&  it,
const Char *  end 
)
staticprivate

◆ parse_header()

int parse_header ( const Char *&  it,
const Char *  end,
format_specs specs 
)
private

Member Data Documentation

◆ args_

Definition at line 349 of file printf.h.

◆ out_

OutputIt out_
private

Definition at line 348 of file printf.h.

◆ parse_ctx_

parse_context_type parse_ctx_
private

Definition at line 350 of file printf.h.