9#include <unordered_map>
44 Option(std::string
const& moduleName, std::string
const& longOptionName, std::string
const& optionDescription,
bool isOptionRequired,
45 bool requireModulePrefix,
bool isAdvanced,
46 std::vector<std::shared_ptr<ArgumentBase>>
const& optionArguments = std::vector<std::shared_ptr<ArgumentBase>>());
60 Option(std::string
const& moduleName, std::string
const& longOptionName, std::string
const& shortOptionName, std::string
const& optionDescription,
61 bool isOptionRequired,
bool requireModulePrefix,
bool isAdvanced,
62 std::vector<std::shared_ptr<ArgumentBase>>
const& optionArguments = std::vector<std::shared_ptr<ArgumentBase>>());
184 std::vector<std::shared_ptr<ArgumentBase>>
const&
getArguments()
const;
197 std::string longName;
203 std::string shortName;
206 std::string description;
209 std::string moduleName;
215 bool requireModulePrefix;
224 bool hasBeenSetWithModulePrefix;
227 std::vector<std::shared_ptr<ArgumentBase>> arguments;
230 std::unordered_map<std::string, std::shared_ptr<ArgumentBase>> argumentNameMap;
246 Option(std::string
const& moduleName, std::string
const& longOptionName, std::string
const& shortOptionName,
bool hasShortOptionName,
247 std::string
const& optionDescription,
bool isOptionRequired,
bool requireModulePrefix,
bool isAdvanced,
248 std::vector<std::shared_ptr<ArgumentBase>>
const& optionArguments = std::vector<std::shared_ptr<ArgumentBase>>());
255 void setHasOptionBeenSet(
bool newValue =
true);
262 void setHasOptionBeenSetWithModulePrefix(
bool newValue =
true);
This class serves as the (untemplated) base class of argument classes.
bool getHasShortName() const
Retrieves whether this option has a short name.
std::string const & getModuleName() const
Retrieves the name of the module to which this option belongs.
std::string const & getDescription() const
Retrieves the description of the option.
uint_fast64_t getArgumentCount() const
Retrieves the argument count this option expects.
friend class SettingsManager
ArgumentBase const & getArgumentByName(std::string const &argumentName) const
Returns a reference to the argument with the specified long name.
bool getHasOptionBeenSetWithModulePrefix() const
Retrieves whether the option has been set by including the module prefix.
friend std::ostream & operator<<(std::ostream &out, Option const &option)
std::string const & getShortName() const
Retrieves the short name of this option.
std::vector< std::shared_ptr< ArgumentBase > > const & getArguments() const
Retrieves the arguments of the option.
bool getIsAdvanced() const
Retrieves whether the option is only displayed in the advanced help.
ArgumentBase const & getArgument(uint_fast64_t argumentIndex) const
Retrieves the i-th argument of this option.
std::string const & getLongName() const
Retrieves the long name of this option.
uint_fast64_t getPrintLength() const
Retrieves the (print) length of the option.
bool getRequiresModulePrefix() const
Retrieves whether the option requires the module name as a prefix.
Option(std::string const &moduleName, std::string const &longOptionName, std::string const &optionDescription, bool isOptionRequired, bool requireModulePrefix, bool isAdvanced, std::vector< std::shared_ptr< ArgumentBase > > const &optionArguments=std::vector< std::shared_ptr< ArgumentBase > >())
Creates an option with the given parameters.
bool getIsRequired() const
Retrieves whether the option is required.
bool getHasOptionBeenSet() const
Retrieves whether the option has been set.
bool isCompatibleWith(Option const &other)
Checks whether the given option is compatible with the current one.
Provides the central API for the registration of command line options and parsing the options from th...
This is the base class of the settings for a particular module.