1 #ifndef MOAB_PROGRAM_OPTIONS_H
2 #define MOAB_PROGRAM_OPTIONS_H
80 ProgOptions(
const std::string& helptext =
"",
const std::string& briefdesc =
"" );
91 void setVersion(
const std::string& version_string,
bool addFlag =
true );
113 template <
typename T >
114 void addOpt(
const std::string& namestring,
const std::string& helpstring, T* value,
int flags = 0 );
121 template <
typename T >
122 void addOpt(
const std::string& namestring,
const std::string& helpstring,
int flags = 0 )
124 addOpt< T >( namestring, helpstring, NULL, flags );
145 template <
typename T >
146 void addRequiredArg(
const std::string& helpname,
const std::string& helpstring, T* value = NULL,
int flags = 0 );
158 template <
typename T >
160 const std::string& helpname,
161 const std::string& helpstring,
167 void printHelp( std::ostream& str = std::cout );
172 void printUsage( std::ostream& str = std::cout );
193 template <
typename T >
194 bool getOpt(
const std::string& namestring, T* value );
208 template <
typename T >
209 void getOptAllArgs(
const std::string& namestring, std::vector< T >& values );
215 int numOptSet(
const std::string& namestring );
222 template <
typename T >
223 T
getReqArg(
const std::string& namestring );
230 template <
typename T >
231 void getArgs(
const std::string& namestring, std::vector< T >& values );
240 void error(
const std::string& message );
250 void get_namestrings(
const std::string& input, std::string* l, std::string* s );
252 ProgOpt*
lookup(
const std::map< std::string, ProgOpt* >&,
const std::string& );
255 bool evaluate(
const ProgOpt& opt,
void* target,
const std::string& option,
unsigned* arg_idx = NULL );