Charades
Public Member Functions | Private Attributes | List of all members
ArgumentSet Class Reference

Class for a set of arguments that can be read from the command line. More...

#include <command_line.h>

Inheritance diagram for ArgumentSet:
AggregateParser Parser

Public Member Functions

 ArgumentSet (std::string n)
 
template<typename ArgType >
void register_argument (std::string name, std::string desc, ArgType &loc)
 Register a new command line argument to be parsed. More...
 
void print () const
 
- Public Member Functions inherited from AggregateParser
void add_parser (Parser *p)
 
bool parse (std::string argument) const
 

Private Attributes

std::string name
 
std::map< std::string, uint8_t > indices
 

Additional Inherited Members

- Protected Attributes inherited from AggregateParser
std::vector< Parser * > parsers
 

Detailed Description

Class for a set of arguments that can be read from the command line.

Constructor & Destructor Documentation

◆ ArgumentSet()

ArgumentSet::ArgumentSet ( std::string  n)
inline
Parameters
nname of the arguments set (shown when using –help)

Member Function Documentation

◆ register_argument()

template<typename ArgType >
void ArgumentSet::register_argument ( std::string  name,
std::string  desc,
ArgType &  loc 
)
inline

Register a new command line argument to be parsed.

Parameters
namename of the argument that will be used on the command line
descdescription of the argument shown when using –help
locthe address where the parsed value should be stored

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