MFEM
v3.3.2
Finite element discretization library
|
#include <optparser.hpp>
Public Types | |
enum | OptionType { INT, DOUBLE, STRING, ENABLE, DISABLE, ARRAY, VECTOR } |
Public Member Functions | |
OptionsParser (int _argc, char *_argv[]) | |
void | AddOption (bool *var, const char *enable_short_name, const char *enable_long_name, const char *disable_short_name, const char *disable_long_name, const char *description, bool required=false) |
void | AddOption (int *var, const char *short_name, const char *long_name, const char *description, bool required=false) |
void | AddOption (double *var, const char *short_name, const char *long_name, const char *description, bool required=false) |
void | AddOption (const char **var, const char *short_name, const char *long_name, const char *description, bool required=false) |
void | AddOption (Array< int > *var, const char *short_name, const char *long_name, const char *description, bool required=false) |
void | AddOption (Vector *var, const char *short_name, const char *long_name, const char *description, bool required=false) |
void | Parse () |
bool | Good () const |
bool | Help () const |
void | PrintOptions (std::ostream &out) const |
void | PrintError (std::ostream &out) const |
void | PrintHelp (std::ostream &out) const |
void | PrintUsage (std::ostream &out) const |
Class for parsing command-line options.
The class is initialized with argc and argv, and new options are added with the AddOption method. Currently options of type bool, int, double, char*, mfem::Array<int>, and mfem::Vector are supported.
See the MFEM examples for sample use.
Definition at line 31 of file optparser.hpp.
Enumerator | |
---|---|
INT | |
DOUBLE | |
STRING | |
ENABLE | |
DISABLE | |
ARRAY | |
VECTOR |
Definition at line 34 of file optparser.hpp.
|
inline |
Definition at line 69 of file optparser.hpp.
|
inline |
Definition at line 74 of file optparser.hpp.
|
inline |
Definition at line 84 of file optparser.hpp.
|
inline |
Definition at line 90 of file optparser.hpp.
|
inline |
Definition at line 96 of file optparser.hpp.
|
inline |
Definition at line 103 of file optparser.hpp.
|
inline |
Definition at line 110 of file optparser.hpp.
|
inline |
Definition at line 120 of file optparser.hpp.
|
inline |
Definition at line 121 of file optparser.hpp.
void mfem::OptionsParser::Parse | ( | ) |
Definition at line 150 of file optparser.cpp.
void mfem::OptionsParser::PrintError | ( | std::ostream & | out | ) | const |
Definition at line 335 of file optparser.cpp.
void mfem::OptionsParser::PrintHelp | ( | std::ostream & | out | ) | const |
Definition at line 378 of file optparser.cpp.
void mfem::OptionsParser::PrintOptions | ( | std::ostream & | out | ) | const |
Definition at line 304 of file optparser.cpp.
void mfem::OptionsParser::PrintUsage | ( | std::ostream & | out | ) | const |
Definition at line 434 of file optparser.cpp.