#include <Options.h>
Definition at line 9 of file Options.h.
◆ Options()
◆ ~Options()
◆ AddOption()
int Options::AddOption |
( |
Option * |
in_oobject | ) |
|
Definition at line 33 of file Options.cpp.
37 vector<Object*>::iterator object;
44 name=in_option->Name();
46 if(!name)
_error_(
"input option has an empty name");
47 if(strchr(name,
'.'))
_error_(
"Option \"" << name <<
"\" has a protected character \".\"");
48 if(strchr(name,
'['))
_error_(
"Option \"" << name <<
"\" has a protected character \"[\"");
49 if(strchr(name,
']'))
_error_(
"Option \"" << name <<
"\" has a protected character \"]\"");
54 option=xDynamicCast<Option*>(*
object);
55 if (!strcmp(option->
Name(),name)){
56 _error_(
"Options \"" << name <<
"\" found multiple times");
◆ GetOption()
Option * Options::GetOption |
( |
const char * |
name | ) |
|
Definition at line 67 of file Options.cpp.
69 vector<Object*>::iterator object;
75 option=xDynamicCast<Option*>(*
object);
79 _printf_(
"The dynamic_cast from Object* to Option* is failing.\n");
81 _printf_(
"A quick workaround consists of using a C-like cast\n");
83 _printf_(
"Open Options.cpp and change the dynamic_cast in Options::GetOption by a C-like cast\n");
86 _error_(
"Make the fix above and recompile ISSM");
89 if (!strncmp(name,option->
Name(),strlen(option->
Name()))){
92 if(!strcmp(name,option->
Name())){
◆ Get() [1/3]
template<class OptionType >
void Options::Get |
( |
OptionType * |
pvalue, |
|
|
const char * |
name |
|
) |
| |
|
inline |
Definition at line 21 of file Options.h.
28 genericoption->
Get(pvalue);
32 _error_(
"option of name \"" << name <<
"\" not found, and no default value has been provided");
◆ Get() [2/3]
template<class OptionType >
void Options::Get |
( |
OptionType * |
pvalue, |
|
|
const char * |
name, |
|
|
OptionType |
default_value |
|
) |
| |
|
inline |
Definition at line 36 of file Options.h.
43 genericoption->
Get(pvalue);
46 if(
GetOption(name))
_printf_(
"WARNING: option "<<name<<
" found but fetched format not consistent, defaulting...\n");
47 *pvalue=default_value;
◆ Get() [3/3]
template<>
void Options::Get |
( |
char ** |
pvalue, |
|
|
const char * |
name, |
|
|
char * |
default_value |
|
) |
| |
|
inline |
Definition at line 56 of file Options.h.
63 genericoption->
Get(pvalue);
67 int stringsize=strlen(default_value)+1;
68 char* outstring=xNew<char>(stringsize);
69 xMemCpy<char>(outstring,default_value,stringsize);
The documentation for this class was generated from the following files: