argagg
Loading...
Searching...
No Matches
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.
 
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.
 
bool known_long_flag (const std::string &flag) const
 Returns true if the provided long flag exists in the map object.
 
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.
 

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.
 
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.
 

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 572 of file argagg.hpp.

Member Function Documentation

◆ get_definition_for_long_flag()

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 1098 of file argagg.hpp.

◆ get_definition_for_short_flag()

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 1081 of file argagg.hpp.

◆ known_long_flag()

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 1089 of file argagg.hpp.

◆ known_short_flag()

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 1073 of file argagg.hpp.

Member Data Documentation

◆ long_map

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 586 of file argagg.hpp.

◆ short_map

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 579 of file argagg.hpp.


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