Loading...
Searching...
No Matches
FormatterBase Class Referenceabstract

This is the minimum requirements to run a formatter. More...

#include <CLI11.h>

+ Inheritance diagram for FormatterBase:

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.
 
virtual std::string make_help (const App *, std::string, AppFormatMode) const =0
 This is the key method that puts together help.
 
Setters
void label (std::string key, std::string val)
 Set the "REQUIRED" label.
 
void column_width (std::size_t val)
 Set the column width.
 
Getters
CLI11_NODISCARD std::string get_label (std::string key) const
 Get the current value of a name (REQUIRED, etc.)
 
CLI11_NODISCARD std::size_t get_column_width () const
 Get the current column width.
 

Protected Attributes

Options
std::size_t column_width_ {30}
 The width of the first column.
 
std::map< std::string, std::string > labels_ {}
 The required help printout labels (user changeable) Values are Needs, Excludes, etc.
 

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.

Definition at line 3997 of file CLI11.h.

Constructor & Destructor Documentation

◆ ~FormatterBase()

virtual ~FormatterBase ( )
inlinevirtualnoexcept

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

Definition at line 4021 of file CLI11.h.

Member Function Documentation

◆ column_width()

void column_width ( std::size_t  val)
inline

Set the column width.

Definition at line 4034 of file CLI11.h.

◆ get_column_width()

CLI11_NODISCARD std::size_t get_column_width ( ) const
inline

Get the current column width.

Definition at line 4048 of file CLI11.h.

◆ get_label()

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

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

Definition at line 4041 of file CLI11.h.

◆ label()

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

Set the "REQUIRED" label.

Definition at line 4031 of file CLI11.h.

◆ make_help()

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

This is the key method that puts together help.

Implemented in Formatter, and FormatterLambda.

Member Data Documentation

◆ column_width_

std::size_t column_width_ {30}
protected

The width of the first column.

Definition at line 4003 of file CLI11.h.

◆ labels_

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

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

Definition at line 4007 of file CLI11.h.


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