ConfigField.h 561 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include <string>
  3. template <typename T>
  4. class ConfigField {
  5. private:
  6. std::string path;
  7. std::string key;
  8. T value;
  9. public:
  10. explicit ConfigField() {}
  11. explicit ConfigField(const std::string path, const std::string key, const T value) {
  12. this->path = path;
  13. this->key = key;
  14. this->value = value;
  15. }
  16. std::string getPath() {
  17. return this->path;
  18. }
  19. std::string getKey() {
  20. return this->key;
  21. }
  22. T& getValue() {
  23. return this->value;
  24. }
  25. void setValue(T value) {
  26. this->value = value;
  27. }
  28. operator bool() {
  29. return this->value;
  30. }
  31. };