mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
A configuration target.
Specifies the details of a configuration target, which is a value that can be set from the command line and/or a config file. A target has a name used as a key for accessing it, and defines how it is set with short and long command line options and the section and key for the config file. Can also include help message details.
Definition at line 53 of file configTarget.hpp.
#include <app/configTarget.hpp>
Public Member Functions | |
configTarget () | |
Default c'tor. More... | |
configTarget (const std::string &n, const std::string &so, const std::string &lo, int clt, const std::string &s, const std::string &kw, bool isReq=false, const std::string &ht="", const std::string &he="", int oa=0) | |
Construct and set values. More... | |
Public Attributes | |
std::string | name |
The name of the target. More... | |
std::string | shortOpt |
The command-line short option (e.g. "f" for -f) More... | |
std::string | longOpt |
The command-line long option (e.g. "file" for –file) More... | |
int | clType {0} |
The command-line option type, argType::false, argType::true, argType::optional, argType::required. More... | |
std::string | section |
The config file section name, can be empty "". More... | |
std::string | keyword |
The config file keyword, read in a "keyword=value" pair. More... | |
bool | set {false} |
true if the value has been set by the configuration, use to distinguish empty strings More... | |
bool | isRequired {false} |
Whether or not this is option is required to be set. More... | |
std::string | helpType |
The type to display in the help message. More... | |
std::string | helpExplanation |
The explanation to display in the help message. More... | |
std::vector< std::string > | values |
holds the values in the order they are set by the configuration More... | |
std::vector< std::string > | sources |
holds the sources of the values (command line or config file path) More... | |
int | verbosity {0} |
Records the verbosity of command line options. E.g. for -v:1, -vv:2, -vvv:3 etc. More... | |
int | orderAdded {0} |
The order in which this was added. Useful for displaying help messages. More... | |
|
inline |
Default c'tor.
Definition at line 78 of file configTarget.hpp.
|
inline |
Construct and set values.
[in] | n | The name of the target |
[in] | so | The command-line short option (e.g. "f" for -f) |
[in] | lo | The command-line long option (e.g. "file" for --file) |
[in] | clt | The command-line option type, argType::false, argType::true, argType::optional, argType::required |
[in] | s | The config file section name, can be empty "" |
[in] | kw | The config file keyword, read in a "keyword=value" pair |
[in] | isReq | Whether or not this is option is required to be set |
[in] | ht | The type to display in the help message |
[in] | he | The explanation to display in the help message |
[in] | oa | [optional] ///< the order in which this was added. |
Definition at line 83 of file configTarget.hpp.
int mx::app::configTarget::clType {0} |
The command-line option type, argType::false, argType::true, argType::optional, argType::required.
Definition at line 58 of file configTarget.hpp.
std::string mx::app::configTarget::helpExplanation |
The explanation to display in the help message.
Definition at line 66 of file configTarget.hpp.
Referenced by mx::app::application::optionHelp().
std::string mx::app::configTarget::helpType |
The type to display in the help message.
Definition at line 65 of file configTarget.hpp.
Referenced by mx::app::application::optionHelp().
bool mx::app::configTarget::isRequired {false} |
Whether or not this is option is required to be set.
Definition at line 64 of file configTarget.hpp.
std::string mx::app::configTarget::keyword |
The config file keyword, read in a "keyword=value" pair.
Definition at line 60 of file configTarget.hpp.
Referenced by mx::app::appConfigurator::add(), and mx::app::application::optionHelp().
std::string mx::app::configTarget::longOpt |
The command-line long option (e.g. "file" for –file)
Definition at line 57 of file configTarget.hpp.
Referenced by mx::app::application::optionHelp().
std::string mx::app::configTarget::name |
The name of the target.
Definition at line 55 of file configTarget.hpp.
Referenced by mx::app::appConfigurator::add().
int mx::app::configTarget::orderAdded {0} |
The order in which this was added. Useful for displaying help messages.
Definition at line 73 of file configTarget.hpp.
Referenced by mx::app::application::optionHelp().
std::string mx::app::configTarget::section |
The config file section name, can be empty "".
Definition at line 59 of file configTarget.hpp.
Referenced by mx::app::appConfigurator::add(), and mx::app::application::optionHelp().
bool mx::app::configTarget::set {false} |
true if the value has been set by the configuration, use to distinguish empty strings
Definition at line 61 of file configTarget.hpp.
std::string mx::app::configTarget::shortOpt |
The command-line short option (e.g. "f" for -f)
Definition at line 56 of file configTarget.hpp.
Referenced by mx::app::application::optionHelp().
std::vector<std::string> mx::app::configTarget::sources |
holds the sources of the values (command line or config file path)
Definition at line 70 of file configTarget.hpp.
std::vector<std::string> mx::app::configTarget::values |
holds the values in the order they are set by the configuration
Definition at line 69 of file configTarget.hpp.
int mx::app::configTarget::verbosity {0} |
Records the verbosity of command line options. E.g. for -v:1, -vv:2, -vvv:3 etc.
Definition at line 72 of file configTarget.hpp.