16#include "ioss_export.h"
27 enum OptType { NoValue, OptionalValue, MandatoryValue };
32 const char *option{
nullptr};
33 const char *description{
nullptr};
34 const char *value{
nullptr};
35 const char *opt_value{
39 bool extra_line{
false};
45 const char *ustring{
nullptr};
49 bool options_parsed{
false};
51 int setcell(Cell *c,
char *valtoken,
char *nexttoken,
const char *name);
57 static char *basename(
char *pathname);
59 int parse(
int argc,
char *
const *argv);
60 int parse(
char *str,
char *p);
62 bool enroll(
const char *opt, OptType t,
const char *desc,
const char *val,
63 const char *optval =
nullptr,
bool extra_line =
false);
64 const char *retrieve(
const char *opt)
const;
65 const char *program_name()
const;
67 void usage(std::ostream &outfile = std::cout)
const;
76 void usage(
const char *str) { ustring = str; }
79 typename std::enable_if<std::is_integral<INT>::value, INT>::type * =
nullptr>
82 INT value = default_value;
83 const char *temp = retrieve(option_txt);
84 if (temp !=
nullptr) {
85 value = std::strtol(temp,
nullptr, 10);
91 typename std::enable_if<std::is_floating_point<DBL>::value, DBL>::type * =
nullptr>
94 DBL value = default_value;
95 const char *temp = retrieve(option_txt);
96 if (temp !=
nullptr) {
97 value = std::strtod(temp,
nullptr);
102 std::string
get_option_value(
const char *option_txt,
const std::string &default_value)
const
104 auto value = default_value;
105 const char *temp = retrieve(option_txt);
106 if (temp !=
nullptr) {
A database of program command line and environment variable options and methods for manipulating them...
Definition Ioss_GetLongOpt.h:25
char optmarker
Definition Ioss_GetLongOpt.h:48
DBL get_option_value(const char *option_txt, DBL default_value)
Definition Ioss_GetLongOpt.h:92
void usage(const char *str)
Set the program usage string.
Definition Ioss_GetLongOpt.h:76
OptType
Definition Ioss_GetLongOpt.h:27
INT get_option_value(const char *option_txt, INT default_value)
Definition Ioss_GetLongOpt.h:80
std::string get_option_value(const char *option_txt, const std::string &default_value) const
Definition Ioss_GetLongOpt.h:102
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
Definition Ioss_GetLongOpt.h:31