Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
CLI::FormatterBase Class Referenceabstract

#include <CLI11.hpp>

Inheritance diagram for CLI::FormatterBase:
Collaboration diagram for CLI::FormatterBase:

Public Member Functions

Basic
 FormatterBase ()=default
 
 FormatterBase (const FormatterBase &)=default
 
 FormatterBase (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
std::string get_label (std::string key) const
 Get the current value of a name (REQUIRED, etc.)
 
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 3177 of file CLI11.hpp.

Constructor & Destructor Documentation

◆ FormatterBase() [1/3]

CLI::FormatterBase::FormatterBase ( )
default

◆ FormatterBase() [2/3]

CLI::FormatterBase::FormatterBase ( const FormatterBase & )
default

◆ FormatterBase() [3/3]

CLI::FormatterBase::FormatterBase ( FormatterBase && )
default

◆ ~FormatterBase()

virtual CLI::FormatterBase::~FormatterBase ( )
inlinevirtualnoexcept

Definition at line 3199 of file CLI11.hpp.

3199{} // NOLINT(modernize-use-equals-default)

Member Function Documentation

◆ column_width()

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

Definition at line 3212 of file CLI11.hpp.

3212{ column_width_ = val; }
std::size_t column_width_
The width of the first column.
Definition CLI11.hpp:3183

◆ get_column_width()

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

Definition at line 3227 of file CLI11.hpp.

3227{ return column_width_; }

◆ get_label()

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

Definition at line 3219 of file CLI11.hpp.

3219 {
3220 if(labels_.find(key) == labels_.end())
3221 return key;
3222 else
3223 return labels_.at(key);
3224 }
std::map< std::string, std::string > labels_
The required help printout labels (user changeable) Values are Needs, Excludes, etc.
Definition CLI11.hpp:3187
uint8_t key[16]
Definition yubico_otp.c:41
Here is the caller graph for this function:

◆ label()

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

Definition at line 3209 of file CLI11.hpp.

3209{ labels_[key] = val; }

◆ make_help()

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

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

Member Data Documentation

◆ column_width_

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

Definition at line 3183 of file CLI11.hpp.

3183{30};

◆ labels_

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

Definition at line 3187 of file CLI11.hpp.

3187{};

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