MOS Source Code
Loading...
Searching...
No Matches
FormatImpl Struct Reference

#include <formatter.hpp>

Classes

struct  formatted_string
 
struct  Formatter
 
struct  is_formatter
 
struct  is_formatter< Formatter< c > >
 

Static Public Member Functions

template<string_literal view, size_t I = 0, size_t StartI = 0>
static consteval auto do_parse_format_string ()
 
template<mos::string_literal view, typename Stream, typename... TArgs>
static constexpr Stream & print_literal (Stream &stream, TArgs... args)
 
template<typename M, typename Stream, typename... TArgs>
static constexpr Stream & print_m (Stream &stream, std::tuple< TArgs... > args)
 

Static Private Member Functions

template<Specifier orig>
static consteval Specifier SetAlignment (Specifier::FormatAlignment alignment)
 
template<Specifier orig>
static consteval Specifier SetWidth (size_t width)
 
template<Specifier orig>
static consteval Specifier SetPrecision (size_t precision)
 
template<Specifier orig>
static consteval Specifier SetSign (Specifier::FormatSign sign)
 
template<Specifier orig>
static consteval Specifier SetFiller (char fill)
 
template<Specifier orig>
static consteval Specifier SetDebugFormat (bool debug_format)
 
template<Specifier orig>
static consteval Specifier SetAlternativeForm (bool alternative_form)
 
static consteval auto tuple_prepend (auto a, auto b=std::tuple())
 
template<typename T>
static consteval bool is_formatter_v ()
 
template<typename T>
static consteval size_t n_dynamic_args ()
 
template<typename... Type>
static consteval size_t n_args_expected (std::tuple<>)
 
template<typename... Type>
static consteval size_t n_args_expected (std::tuple< Type... >)
 
template<string_literal view, size_t I, size_t End, size_t Result = 0>
static consteval size_t __do_parse_int ()
 
template<string_literal view, size_t IStart>
static consteval size_t __do_find_integer_boundary ()
 
template<string_literal view, size_t I, size_t StartI, Specifier config>
static consteval auto do_parse_specifier ()
 
template<size_t StartI, size_t N, typename... Args>
static constexpr auto get_slice (const std::tuple< Args... > &args)
 
template<typename... TArgs>
static constexpr auto first_arg (const std::tuple< TArgs... > &args)
 
template<size_t N, typename... TArgs>
static constexpr auto first_n_args (const std::tuple< TArgs... > &args)
 
template<typename... TArgs>
static constexpr auto rest_args (const std::tuple< TArgs... > &args)
 
template<size_t N, typename... TArgs>
static constexpr auto rest_args_from (const std::tuple< TArgs... > &args)
 
template<typename Stream, typename... TArgs>
static constexpr auto do_next_print (Stream &stream, std::tuple< TArgs... > str_format_tuple)
 
template<typename Stream, typename... TSpecs, typename TSpec, typename TArg, typename... TArgs>
static constexpr auto do_next_print (Stream &stream, TSpec spec, const std::tuple< TSpecs... > &specs, const TArg &arg, const std::tuple< TArgs... > &args)
 

Detailed Description

Definition at line 66 of file formatter.hpp.

Member Function Documentation

◆ SetAlignment()

template<Specifier orig>
static consteval Specifier SetAlignment ( Specifier::FormatAlignment alignment)
inlinestaticconstevalprivate

Definition at line 107 of file formatter.hpp.

Referenced by do_parse_specifier().

◆ SetWidth()

template<Specifier orig>
static consteval Specifier SetWidth ( size_t width)
inlinestaticconstevalprivate

Definition at line 116 of file formatter.hpp.

◆ SetPrecision()

template<Specifier orig>
static consteval Specifier SetPrecision ( size_t precision)
inlinestaticconstevalprivate

Definition at line 126 of file formatter.hpp.

◆ SetSign()

template<Specifier orig>
static consteval Specifier SetSign ( Specifier::FormatSign sign)
inlinestaticconstevalprivate

Definition at line 136 of file formatter.hpp.

Referenced by do_parse_specifier().

◆ SetFiller()

template<Specifier orig>
static consteval Specifier SetFiller ( char fill)
inlinestaticconstevalprivate

Definition at line 145 of file formatter.hpp.

◆ SetDebugFormat()

template<Specifier orig>
static consteval Specifier SetDebugFormat ( bool debug_format)
inlinestaticconstevalprivate

Definition at line 154 of file formatter.hpp.

Referenced by do_parse_specifier().

◆ SetAlternativeForm()

template<Specifier orig>
static consteval Specifier SetAlternativeForm ( bool alternative_form)
inlinestaticconstevalprivate

Definition at line 163 of file formatter.hpp.

Referenced by do_parse_specifier().

◆ tuple_prepend()

static consteval auto tuple_prepend ( auto a,
auto b = std::tuple() )
inlinestaticconstevalprivate

Definition at line 172 of file formatter.hpp.

Referenced by do_parse_format_string(), and do_parse_specifier().

◆ is_formatter_v()

template<typename T>
static consteval bool is_formatter_v ( )
inlinestaticconstevalprivate

Definition at line 180 of file formatter.hpp.

Referenced by do_next_print(), n_args_expected(), and n_dynamic_args().

◆ n_dynamic_args()

template<typename T>
static consteval size_t n_dynamic_args ( )
inlinestaticconstevalprivate

Definition at line 184 of file formatter.hpp.

Referenced by n_args_expected(), and n_dynamic_args().

+ Here is the call graph for this function:

◆ n_args_expected() [1/2]

template<typename... Type>
static consteval size_t n_args_expected ( std::tuple<> )
inlinestaticconstevalprivate

Definition at line 193 of file formatter.hpp.

Referenced by print_literal(), and print_m().

◆ n_args_expected() [2/2]

template<typename... Type>
static consteval size_t n_args_expected ( std::tuple< Type... > )
inlinestaticconstevalprivate

Definition at line 199 of file formatter.hpp.

+ Here is the call graph for this function:

◆ __do_parse_int()

template<string_literal view, size_t I, size_t End, size_t Result = 0>
static consteval size_t __do_parse_int ( )
inlinestaticconstevalprivate

Definition at line 205 of file formatter.hpp.

Referenced by __do_parse_int(), and do_parse_specifier().

+ Here is the call graph for this function:

◆ __do_find_integer_boundary()

template<string_literal view, size_t IStart>
static consteval size_t __do_find_integer_boundary ( )
inlinestaticconstevalprivate

Definition at line 214 of file formatter.hpp.

Referenced by __do_find_integer_boundary(), and do_parse_specifier().

+ Here is the call graph for this function:

◆ do_parse_specifier()

template<string_literal view, size_t I, size_t StartI, Specifier config>
static consteval auto do_parse_specifier ( )
inlinestaticconstevalprivate

Definition at line 223 of file formatter.hpp.

Referenced by do_parse_format_string(), and do_parse_specifier().

+ Here is the call graph for this function:

◆ get_slice()

template<size_t StartI, size_t N, typename... Args>
static constexpr auto get_slice ( const std::tuple< Args... > & args)
inlinestaticconstexprprivate

Definition at line 286 of file formatter.hpp.

Referenced by first_n_args(), get_slice(), rest_args(), and rest_args_from().

+ Here is the call graph for this function:

◆ first_arg()

template<typename... TArgs>
static constexpr auto first_arg ( const std::tuple< TArgs... > & args)
inlinestaticconstexprprivate

Definition at line 295 of file formatter.hpp.

Referenced by do_next_print(), do_next_print(), print_literal(), and print_m().

◆ first_n_args()

template<size_t N, typename... TArgs>
static constexpr auto first_n_args ( const std::tuple< TArgs... > & args)
inlinestaticconstexprprivate

Definition at line 301 of file formatter.hpp.

Referenced by do_next_print().

+ Here is the call graph for this function:

◆ rest_args()

template<typename... TArgs>
static constexpr auto rest_args ( const std::tuple< TArgs... > & args)
inlinestaticconstexprprivate

Definition at line 307 of file formatter.hpp.

Referenced by do_next_print(), print_literal(), and print_m().

+ Here is the call graph for this function:

◆ rest_args_from()

template<size_t N, typename... TArgs>
static constexpr auto rest_args_from ( const std::tuple< TArgs... > & args)
inlinestaticconstexprprivate

Definition at line 313 of file formatter.hpp.

Referenced by do_next_print().

+ Here is the call graph for this function:

◆ do_next_print() [1/2]

template<typename Stream, typename... TArgs>
static constexpr auto do_next_print ( Stream & stream,
std::tuple< TArgs... > str_format_tuple )
inlinestaticconstexprprivate

Definition at line 319 of file formatter.hpp.

Referenced by do_next_print(), print_literal(), and print_m().

+ Here is the call graph for this function:

◆ do_next_print() [2/2]

template<typename Stream, typename... TSpecs, typename TSpec, typename TArg, typename... TArgs>
static constexpr auto do_next_print ( Stream & stream,
TSpec spec,
const std::tuple< TSpecs... > & specs,
const TArg & arg,
const std::tuple< TArgs... > & args )
inlinestaticconstexprprivate

Definition at line 329 of file formatter.hpp.

+ Here is the call graph for this function:

◆ do_parse_format_string()

template<string_literal view, size_t I = 0, size_t StartI = 0>
static consteval auto do_parse_format_string ( )
inlinestaticconsteval

Definition at line 368 of file formatter.hpp.

Referenced by do_parse_format_string(), do_parse_specifier(), print_literal(), and print_m().

+ Here is the call graph for this function:

◆ print_literal()

template<mos::string_literal view, typename Stream, typename... TArgs>
static constexpr Stream & print_literal ( Stream & stream,
TArgs... args )
inlinestaticconstexpr

Definition at line 394 of file formatter.hpp.

+ Here is the call graph for this function:

◆ print_m()

template<typename M, typename Stream, typename... TArgs>
static constexpr Stream & print_m ( Stream & stream,
std::tuple< TArgs... > args )
inlinestaticconstexpr

Definition at line 413 of file formatter.hpp.

Referenced by SyslogStreamWriter::operator<<().

+ Here is the call graph for this function:

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