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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. class CommandLineOption
  9. {
  10. public:
  11. CommandLineOption(const std::string& longName, char shortName, const std::string& description,
  12. const std::string& valueName = "", const std::string& defaultValue = "");
  13. const std::string &getLongName() const;
  14. void setLongName(const std::string &longName);
  15. char getShortName() const;
  16. void setShortName(char shortName);
  17. const std::string &getDescription() const;
  18. void setDescription(const std::string &description);
  19. const std::string &getValueName() const;
  20. void setValueName(const std::string &valueName);
  21. const std::string &getDefaultValue() const;
  22. void setDefaultValue(const std::string &defaultValue);
  23. const std::vector<std::string> &getValues() const;
  24. const std::string &getValue() const;
  25. void addValue(const std::string &value);
  26. bool isSet() const;
  27. void setIsSet(bool isSet);
  28. bool hasValue() const;
  29. private:
  30. std::string _longName;
  31. char _shortName;
  32. std::string _description;
  33. std::string _valueName;
  34. std::string _defaultValue;
  35. std::vector<std::string> _values;
  36. bool _isSet;
  37. };
  38. #endif //PDNS_SLAVE_COMMANDLINEOPTION_H