arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::policy::default_help_formatter_t< Indent, DescColumnOffset, LineFormatter, PreambleFormatter, AddendumFormatter > Class Template Reference

#include <arg_router/policy/default_help_formatter.hpp>

Static Public Member Functions

template<typename Node , typename HelpNode , bool Flatten>
static void generate_help (std::ostream &stream)
 
template<typename Node , typename HelpNode , bool Flatten>
static void generate_help (std::ostream &stream, const runtime_help_data &help_data)
 

Detailed Description

template<typename Indent = traits::integral_constant<std::size_t{4}>, typename DescColumnOffset = traits::integral_constant<Indent{} * 2>, typename LineFormatter = help_formatter_component::default_line_formatter<Indent{}>, typename PreambleFormatter = help_formatter_component::default_preamble_formatter, typename AddendumFormatter = help_formatter_component::default_addendum_formatter>
class arg_router::policy::default_help_formatter_t< Indent, DescColumnOffset, LineFormatter, PreambleFormatter, AddendumFormatter >

Default help formatter, used when none is specified when defining a help node.

Template Parameters
IndentNumber of spaces per 'level' of indentation, defaults to 4
DescColumnOffsetMinimum number of description columns remaining in a terminal line needed to attempt proper line breaks i.e. if it is less than DescColumnOffset then the output just overflows onto the next line, defaults to 8
LineFormatterLine formatter type
PreambleFormatterControls preamble formatting i.e. the 'intro' part of the output that goes before the argument output
AddendumFormatterControls addendum formatting i.e. the part of the output that goes after the argument output

Definition at line 232 of file default_help_formatter.hpp.

Member Function Documentation

◆ generate_help() [1/2]

template<typename Indent = traits::integral_constant<std::size_t{4}>, typename DescColumnOffset = traits::integral_constant<Indent{} * 2>, typename LineFormatter = help_formatter_component::default_line_formatter<Indent{}>, typename PreambleFormatter = help_formatter_component::default_preamble_formatter, typename AddendumFormatter = help_formatter_component::default_addendum_formatter>
template<typename Node , typename HelpNode , bool Flatten>
static void arg_router::policy::default_help_formatter_t< Indent, DescColumnOffset, LineFormatter, PreambleFormatter, AddendumFormatter >::generate_help ( std::ostream &  stream)
inlinestatic

Generates the help string.

Recurses through the parse tree, starting at Node, at compile time to build a string representation of it. The program name, version, and info are always generated if the policies are available.

Template Parameters
NodeThe node type to begin help output generation from (typically the root)
HelpNodeParent help node
FlattenTrue to display all nested help data
Parameters
streamOutput stream to write the output to

Definition at line 252 of file default_help_formatter.hpp.

◆ generate_help() [2/2]

template<typename Indent = traits::integral_constant<std::size_t{4}>, typename DescColumnOffset = traits::integral_constant<Indent{} * 2>, typename LineFormatter = help_formatter_component::default_line_formatter<Indent{}>, typename PreambleFormatter = help_formatter_component::default_preamble_formatter, typename AddendumFormatter = help_formatter_component::default_addendum_formatter>
template<typename Node , typename HelpNode , bool Flatten>
static void arg_router::policy::default_help_formatter_t< Indent, DescColumnOffset, LineFormatter, PreambleFormatter, AddendumFormatter >::generate_help ( std::ostream &  stream,
const runtime_help_data help_data 
)
inlinestatic

Overload for runtime_help_data.

Template Parameters
NodeThe node type to begin help output generation from (typically the root)
HelpNodeParent help node
FlattenTrue to display all nested help data
Parameters
streamOutput stream to write the output to
help_dataParent runtime help data

Definition at line 266 of file default_help_formatter.hpp.


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