CLI11  2.5.0
List of all members
CLI::FormatterBase Class Referenceabstract

#include <FormatterFwd.hpp>

Inheritance diagram for CLI::FormatterBase:
Inheritance graph
[legend]
Collaboration diagram for CLI::FormatterBase:
Collaboration graph
[legend]

Public Member Functions

Basic
 FormatterBase ()=default
 
 FormatterBase (const FormatterBase &)=default
 
 FormatterBase (FormatterBase &&)=default
 
FormatterBaseoperator= (const FormatterBase &)=default
 
FormatterBaseoperator= (FormatterBase &&)=default
 
virtual ~FormatterBase () noexcept
 Adding a destructor in this form to work around bug in GCC 4.7. More...
 
virtual std::string make_help (const App *, std::string, AppFormatMode) const =0
 This is the key method that puts together help. More...
 
Setters
void label (std::string key, std::string val)
 Set the "REQUIRED" label. More...
 
void column_width (std::size_t val)
 Set the left column width (options/flags/subcommands) More...
 
void right_column_width (std::size_t val)
 Set the right column width (description of options/flags/subcommands) More...
 
void description_paragraph_width (std::size_t val)
 Set the description paragraph width at the top of help. More...
 
void footer_paragraph_width (std::size_t val)
 Set the footer paragraph width. More...
 
Getters
CLI11_NODISCARD std::string get_label (std::string key) const
 Get the current value of a name (REQUIRED, etc.) More...
 
CLI11_NODISCARD std::size_t get_column_width () const
 Get the current left column width (options/flags/subcommands) More...
 
CLI11_NODISCARD std::size_t get_right_column_width () const
 Get the current right column width (description of options/flags/subcommands) More...
 
CLI11_NODISCARD std::size_t get_description_paragraph_width () const
 Get the current description paragraph width at the top of help. More...
 
CLI11_NODISCARD std::size_t get_footer_paragraph_width () const
 Get the current footer paragraph width. More...
 

Protected Attributes

Options
std::size_t column_width_ {30}
 The width of the left column (options/flags/subcommands) More...
 
std::size_t right_column_width_ {65}
 The width of the right column (description of options/flags/subcommands) More...
 
std::size_t description_paragraph_width_ {80}
 The width of the description paragraph at the top of help. More...
 
std::size_t footer_paragraph_width_ {80}
 The width of the footer paragraph. More...
 
std::map< std::string, std::string > labels_ {}
 The required help printout labels (user changeable) Values are Needs, Excludes, etc. More...
 

Detailed Description

This is the minimum requirements to run a formatter.

A user can subclass this is if they do not care at all about the structure in CLI::Formatter.

Constructor & Destructor Documentation

CLI::FormatterBase::FormatterBase ( )
default
CLI::FormatterBase::FormatterBase ( const FormatterBase )
default
CLI::FormatterBase::FormatterBase ( FormatterBase &&  )
default
virtual CLI::FormatterBase::~FormatterBase ( )
inlinevirtualnoexcept

Adding a destructor in this form to work around bug in GCC 4.7.

Member Function Documentation

void CLI::FormatterBase::column_width ( std::size_t  val)
inline

Set the left column width (options/flags/subcommands)

void CLI::FormatterBase::description_paragraph_width ( std::size_t  val)
inline

Set the description paragraph width at the top of help.

void CLI::FormatterBase::footer_paragraph_width ( std::size_t  val)
inline

Set the footer paragraph width.

CLI11_NODISCARD std::size_t CLI::FormatterBase::get_column_width ( ) const
inline

Get the current left column width (options/flags/subcommands)

CLI11_NODISCARD std::size_t CLI::FormatterBase::get_description_paragraph_width ( ) const
inline

Get the current description paragraph width at the top of help.

CLI11_NODISCARD std::size_t CLI::FormatterBase::get_footer_paragraph_width ( ) const
inline

Get the current footer paragraph width.

CLI11_NODISCARD std::string CLI::FormatterBase::get_label ( std::string  key) const
inline

Get the current value of a name (REQUIRED, etc.)

CLI11_NODISCARD std::size_t CLI::FormatterBase::get_right_column_width ( ) const
inline

Get the current right column width (description of options/flags/subcommands)

void CLI::FormatterBase::label ( std::string  key,
std::string  val 
)
inline

Set the "REQUIRED" label.

virtual std::string CLI::FormatterBase::make_help ( const App ,
std::string  ,
AppFormatMode   
) const
pure virtual

This is the key method that puts together help.

Implemented in CLI::Formatter, and CLI::FormatterLambda.

FormatterBase& CLI::FormatterBase::operator= ( const FormatterBase )
default
FormatterBase& CLI::FormatterBase::operator= ( FormatterBase &&  )
default
void CLI::FormatterBase::right_column_width ( std::size_t  val)
inline

Set the right column width (description of options/flags/subcommands)

Member Data Documentation

std::size_t CLI::FormatterBase::column_width_ {30}
protected

The width of the left column (options/flags/subcommands)

std::size_t CLI::FormatterBase::description_paragraph_width_ {80}
protected

The width of the description paragraph at the top of help.

std::size_t CLI::FormatterBase::footer_paragraph_width_ {80}
protected

The width of the footer paragraph.

std::map<std::string, std::string> CLI::FormatterBase::labels_ {}
protected

The required help printout labels (user changeable) Values are Needs, Excludes, etc.

std::size_t CLI::FormatterBase::right_column_width_ {65}
protected

The width of the right column (description of options/flags/subcommands)


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