You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommandLineOption.h 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // Created by robin on 8/8/15.
  3. //
  4. #ifndef PDNS_SLAVE_COMMANDLINEOPTION_H
  5. #define PDNS_SLAVE_COMMANDLINEOPTION_H
  6. # include <string>
  7. # include <vector>
  8. #include <cli/CommandLineParser.h>
  9. class CommandLineParser;
  10. class CommandLineOption
  11. {
  12. public:
  13. CommandLineOption(CommandLineParser* parser, const std::string& longName, char shortName,
  14. const std::string& description, const std::string& valueName = "",
  15. const std::string& defaultValue = "");
  16. const std::string &getLongName() const;
  17. void setLongName(const std::string &longName);
  18. char getShortName() const;
  19. void setShortName(char shortName);
  20. const std::string &getDescription() const;
  21. void setDescription(const std::string &description);
  22. const std::string &getValueName() const;
  23. void setValueName(const std::string &valueName);
  24. const std::string &getDefaultValue() const;
  25. void setDefaultValue(const std::string &defaultValue);
  26. const std::vector<std::string> &getValues() const;
  27. const std::string &getValue() const;
  28. void addValue(const std::string &value);
  29. bool isSet() const;
  30. void setIsSet(bool isSet);
  31. bool hasValue() const;
  32. private:
  33. std::string _longName;
  34. char _shortName;
  35. std::string _description;
  36. std::string _valueName;
  37. std::string _defaultValue;
  38. std::vector<std::string> _values;
  39. bool _isSet;
  40. };
  41. #endif //PDNS_SLAVE_COMMANDLINEOPTION_H