args-parser 6.3.3
Loading...
Searching...
No Matches
Args::HelpPrinter Class Reference

HelpPrinter is a class that prints help. More...

#include <help_printer.hpp>

+ Inheritance diagram for Args::HelpPrinter:
+ Collaboration diagram for Args::HelpPrinter:

Public Types

using ArgPtr = std::unique_ptr< ArgIface, details::Deleter< ArgIface > >
 Smart pointer to the argument.
 

Public Member Functions

 HelpPrinter ()
 
virtual ~HelpPrinter ()
 
void print (OutStreamType &to) override
 Print help for all arguments.
 
void print (const String &name, OutStreamType &to, Command *parent=nullptr) override
 Print help for the given argument.
 
void setExecutable (const String &exe) override
 Set executable name.
 
void setAppDescription (const String &desc) override
 Set description for the application.
 
void setCmdLine (CmdLine *cmd) override
 Set command line.
 
void setLineLength (String::size_type length) override
 Set line length for the help.
 
ArgIfacefindArgument (const String &name) override
 
- Public Member Functions inherited from Args::HelpPrinterIface
 HelpPrinterIface ()
 
virtual ~HelpPrinterIface ()
 

Detailed Description

HelpPrinter is a class that prints help.

Definition at line 63 of file help_printer.hpp.

Member Typedef Documentation

◆ ArgPtr

Smart pointer to the argument.

Definition at line 68 of file help_printer.hpp.

Constructor & Destructor Documentation

◆ HelpPrinter()

Args::HelpPrinter::HelpPrinter ( )
inline

Definition at line 157 of file help_printer.hpp.

◆ ~HelpPrinter()

Args::HelpPrinter::~HelpPrinter ( )
inlinevirtual

Definition at line 164 of file help_printer.hpp.

Member Function Documentation

◆ findArgument()

ArgIface * Args::HelpPrinter::findArgument ( const String name)
inlineoverridevirtual
Returns
Argument for the given name.

Implements Args::HelpPrinterIface.

Definition at line 101 of file help_printer.hpp.

◆ print() [1/2]

void Args::HelpPrinter::print ( const String name,
OutStreamType to,
Command parent = nullptr 
)
inlineoverridevirtual

Print help for the given argument.

Parameters
nameName of the argument. I.e. "-t" or "--timeout".
toOutput stream for the printing help.
parentParent command if present.

Implements Args::HelpPrinterIface.

Definition at line 492 of file help_printer.hpp.

◆ print() [2/2]

void Args::HelpPrinter::print ( OutStreamType to)
inlineoverridevirtual

Print help for all arguments.

Parameters
toOutput stream for the printing help.

Implements Args::HelpPrinterIface.

Definition at line 345 of file help_printer.hpp.

◆ setAppDescription()

void Args::HelpPrinter::setAppDescription ( const String desc)
inlineoverridevirtual

Set description for the application.

Implements Args::HelpPrinterIface.

Definition at line 708 of file help_printer.hpp.

◆ setCmdLine()

void Args::HelpPrinter::setCmdLine ( CmdLine cmd)
inlineoverridevirtual

Set command line.

Implements Args::HelpPrinterIface.

Definition at line 714 of file help_printer.hpp.

◆ setExecutable()

void Args::HelpPrinter::setExecutable ( const String exe)
inlineoverridevirtual

Set executable name.

Implements Args::HelpPrinterIface.

Definition at line 702 of file help_printer.hpp.

◆ setLineLength()

void Args::HelpPrinter::setLineLength ( String::size_type  length)
inlineoverridevirtual

Set line length for the help.

Implements Args::HelpPrinterIface.

Definition at line 720 of file help_printer.hpp.


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