argagg
 All Classes Namespaces Files Functions Variables Macros Pages
Public Member Functions | Public Attributes | List of all members
argagg::parser_map Struct Reference

Contains two maps which aid in option parsing. The first map, short_map, maps from a short flag (just a character) to a pointer to the original definition that the flag represents. The second map, long_map, maps from a long flag (an std::string) to a pointer to the original definition that the flag represents. More...

#include <argagg.hpp>

Public Member Functions

bool known_short_flag (const char flag) const
 Returns true if the provided short flag exists in the map object. More...
 
const definitionget_definition_for_short_flag (const char flag) const
 If the short flag exists in the map object then it is returned by this method. If it doesn't then nullptr will be returned. More...
 
bool known_long_flag (const std::string &flag) const
 Returns true if the provided long flag exists in the map object. More...
 
const definitionget_definition_for_long_flag (const std::string &flag) const
 If the long flag exists in the map object then it is returned by this method. If it doesn't then nullptr will be returned. More...
 

Public Attributes

std::array< const definition *, 256 > short_map
 Maps from a short flag (just a character) to a pointer to the original definition that the flag represents. More...
 
std::unordered_map
< std::string, const
definition * > 
long_map
 Maps from a long flag (an std::string) to a pointer to the original definition that the flag represents. More...
 

Detailed Description

Contains two maps which aid in option parsing. The first map, short_map, maps from a short flag (just a character) to a pointer to the original definition that the flag represents. The second map, long_map, maps from a long flag (an std::string) to a pointer to the original definition that the flag represents.

This object is usually a temporary that only exists during the parsing operation. It is typically constructed using validate_definitions().

Definition at line 472 of file argagg.hpp.

Member Function Documentation

const definition * argagg::parser_map::get_definition_for_long_flag ( const std::string flag) const
inline

If the long flag exists in the map object then it is returned by this method. If it doesn't then nullptr will be returned.

Definition at line 993 of file argagg.hpp.

const definition * argagg::parser_map::get_definition_for_short_flag ( const char  flag) const
inline

If the short flag exists in the map object then it is returned by this method. If it doesn't then nullptr will be returned.

Definition at line 976 of file argagg.hpp.

bool argagg::parser_map::known_long_flag ( const std::string flag) const
inline

Returns true if the provided long flag exists in the map object.

Definition at line 984 of file argagg.hpp.

bool argagg::parser_map::known_short_flag ( const char  flag) const
inline

Returns true if the provided short flag exists in the map object.

Definition at line 968 of file argagg.hpp.

Member Data Documentation

std::unordered_map<std::string, const definition*> argagg::parser_map::long_map

Maps from a long flag (an std::string) to a pointer to the original definition that the flag represents.

Definition at line 486 of file argagg.hpp.

std::array<const definition*, 256> argagg::parser_map::short_map

Maps from a short flag (just a character) to a pointer to the original definition that the flag represents.

Definition at line 479 of file argagg.hpp.


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