args  6.2.0
A simple single-header C++11 STL-only argument parser library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
args::NamedBase Class Reference

Base class for all match types that have a name. More...

#include <args.hxx>

Inheritance diagram for args::NamedBase:
args::Base args::FlagBase args::PositionalBase args::ActionFlag args::Flag args::NargsValueFlag< T, List, Reader > args::ValueFlagBase args::MapPositional< K, T, Reader, Map > args::MapPositionalList< K, T, List, Reader, Map > args::Positional< T, Reader > args::PositionalList< T, List, Reader >

Public Member Functions

 NamedBase (const std::string &name_, const std::string &help_, Options options_={})
 
void HelpDefault (const std::string &str)
 Sets default value string that will be added to argument description. More...
 
std::string HelpDefault (const HelpParams &params) const
 Gets default value string that will be added to argument description.
 
void HelpChoices (const std::vector< std::string > &array)
 Sets choices strings that will be added to argument description. More...
 
std::vector< std::string > HelpChoices (const HelpParams &params) const
 Gets choices strings that will be added to argument description.
 
virtual std::vector< std::tuple< std::string, std::string, unsigned > > GetDescription (const HelpParams &params, const unsigned indentLevel) const override
 
virtual std::string Name () const
 
- Public Member Functions inherited from args::Base
 Base (const std::string &help_, Options options_={})
 
Options GetOptions () const noexcept
 
bool IsRequired () const noexcept
 
virtual bool Matched () const noexcept
 
virtual void Validate (const std::string &, const std::string &) const
 
 operator bool () const noexcept
 
virtual std::vector< Command * > GetCommands ()
 
virtual bool IsGroup () const
 
virtual FlagBaseMatch (const EitherFlag &)
 
virtual PositionalBaseGetNextPositional ()
 
virtual std::vector< FlagBase * > GetAllFlags ()
 
virtual bool HasFlag () const
 
virtual bool HasPositional () const
 
virtual bool HasCommand () const
 
virtual std::vector< std::string > GetProgramLine (const HelpParams &) const
 
void KickOut (bool kickout_) noexcept
 Sets a kick-out value for building subparsers.
 
bool KickOut () const noexcept
 Gets the kick-out value for building subparsers.
 
virtual void Reset () noexcept
 

Protected Member Functions

virtual std::string GetDefaultString (const HelpParams &) const
 
virtual std::vector< std::string > GetChoicesStrings (const HelpParams &) const
 
virtual std::string GetNameString (const HelpParams &) const
 
void AddDescriptionPostfix (std::string &dest, const bool isManual, const std::string &manual, bool isGenerated, const std::string &generated, const std::string &str) const
 

Protected Attributes

const std::string name
 
bool kickout = false
 
std::string defaultString
 
bool defaultStringManual = false
 
std::vector< std::string > choicesStrings
 
bool choicesStringManual = false
 
- Protected Attributes inherited from args::Base
bool matched = false
 
const std::string help
 

Detailed Description

Base class for all match types that have a name.

Member Function Documentation

◆ HelpChoices()

void args::NamedBase::HelpChoices ( const std::vector< std::string > &  array)
inline

Sets choices strings that will be added to argument description.

Use empty vector to disable it for this argument.

◆ HelpDefault()

void args::NamedBase::HelpDefault ( const std::string &  str)
inline

Sets default value string that will be added to argument description.

Use empty string to disable it for this argument.


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