21#ifndef G_OPTION_PARSER_H
22#define G_OPTION_PARSER_H
55 std::size_t ignore_non_options = 0U ) ;
86 std::size_t start_position = 1U , std::size_t ignore_non_options = 0U ) ;
99 bool haveSeen(
const std::string & )
const ;
100 bool haveSeenSame(
const std::string & ,
const std::string & )
const ;
101 static std::string::size_type eqPos(
const std::string & ) ;
102 static std::string eqValue(
const std::string & , std::string::size_type ) ;
103 void processOptionOn(
char c ) ;
104 void processOption(
char c ,
const std::string & value ) ;
105 void processOptionOn(
const std::string & s ) ;
106 void processOptionOff(
const std::string & s ) ;
107 void processOption(
const std::string & s ,
const std::string & value ,
bool ) ;
108 void errorNoValue(
char ) ;
109 void errorNoValue(
const std::string & ) ;
110 void errorUnknownOption(
char ) ;
111 void errorUnknownOption(
const std::string & ) ;
112 void errorDubiousValue(
const std::string & ,
const std::string & ) ;
114 void errorExtraValue(
char ,
const std::string & ) ;
115 void errorExtraValue(
const std::string & ,
const std::string & ) ;
116 void errorConflict(
const std::string & ) ;
117 void error(
const std::string & ) ;
118 bool haveSeenOn(
const std::string & name )
const ;
119 bool haveSeenOff(
const std::string & name )
const ;
120 static bool isOldOption(
const std::string & ) ;
121 static bool isNewOption(
const std::string & ) ;
122 static bool isAnOptionSet(
const std::string & ) ;
123 static std::size_t valueCount(
const std::string & ) ;
A multimap-like container for command-line options and their values.
A parser for command-line arguments that operates according to an Options specification and returns a...
void errorDuplicate(const std::string &)
Adds a 'duplicate' error in the constructor's error list for the given option.
OptionParser(const Options &spec, OptionMap &values_out, StringArray &errors_out)
Constructor.
StringArray parse(const StringArray &args_in, std::size_t start_position=1U, std::size_t ignore_non_options=0U)
Parses the given command-line arguments into the value map and/or error list defined by the construct...
A class to represent allowed command-line options and to provide command-line usage text.
std::vector< std::string > StringArray
A std::vector of std::strings.