Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
option_parser Struct Reference

#include <option.h>

Public Member Functions

 option_parser (int argc, char **argv)
 Parse the options from the commandline arguments (argc,argv)
 
std::vector< std::string > validate (const std::set< std::string > &keywords) const
 check keys in the options are in the set keywords.
 
template<typename RET >
RET get (const std::string &key) const
 retrieve an option
 
template<typename RET >
RET get (const std::string &key, const RET &default_value) const
 retrieve an option
 

Private Attributes

std::map< std::string, std::string > _map
 

Constructor & Destructor Documentation

◆ option_parser()

option_parser ( int  argc,
char **  argv 
)
inline

Parse the options from the commandline arguments (argc,argv)

Member Function Documentation

◆ get() [1/2]

RET get ( const std::string &  key) const
inline

retrieve an option

◆ get() [2/2]

RET get ( const std::string &  key,
const RET &  default_value 
) const
inline

retrieve an option

◆ validate()

std::vector< std::string > validate ( const std::set< std::string > &  keywords) const
inline

check keys in the options are in the set keywords.

Returns
vector of erroneous keywords in options.

Member Data Documentation

◆ _map

std::map<std::string, std::string> _map
private

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