Definition at line 14 of file OptionParams.h.
Public Types | |
enum | eType { TYPE_NUMBER, TYPE_BOOLEAN, TYPE_STRING, TYPE_PATH } |
Public Member Functions | |
OptionParams () | |
void | addParam (const std::string &name, eType type, const std::string &help) |
std::string | getHelp (const Environ *options) const |
std::string | getConfig (const Environ *options) const |
Data Structures | |
struct | Param |
|
Definition at line 16 of file OptionParams.h. 00016 { 00017 TYPE_NUMBER, 00018 TYPE_BOOLEAN, 00019 TYPE_STRING, 00020 TYPE_PATH 00021 };
|
|
Definition at line 35 of file OptionParams.h. 00035 { m_maxSize = 0; }
|
|
Definition at line 16 of file OptionParams.cpp. 00018 { 00019 Param param(type, help); 00020 m_params.insert( 00021 std::pair<std::string,Param>(name, param)); 00022 int paramSize = name.size() + getType(type).size(); 00023 if (paramSize > m_maxSize) { 00024 m_maxSize = paramSize; 00025 } 00026 }
|
|
Definition at line 43 of file OptionParams.cpp. 00044 { 00045 std::string config; 00046 t_params::const_iterator end = m_params.end(); 00047 for (t_params::const_iterator i = m_params.begin(); i != end; ++i) { 00048 config += i->first + "='" + options->getParam(i->first) + "'\n"; 00049 } 00050 return config; 00051 }
|
|
Definition at line 29 of file OptionParams.cpp. 00030 { 00031 std::string help; 00032 t_params::const_iterator end = m_params.end(); 00033 for (t_params::const_iterator i = m_params.begin(); i != end; ++i) { 00034 int paramSize = i->first.size() + getType(i->second.type).size(); 00035 std::string space = std::string(m_maxSize - paramSize, ' '); 00036 help += " " + i->first + "=<" + getType(i->second.type) + ">"; 00037 help += space + " " + i->second.help + "\n"; 00038 } 00039 return help; 00040 }
|