string_setting.h 764 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2012-2014 Daniele Bartolini and individual contributors.
  3. * License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. */
  5. #pragma once
  6. #include "types.h"
  7. namespace crown
  8. {
  9. /// Facility to store global string settings.
  10. class StringSetting
  11. {
  12. public:
  13. StringSetting(const char* name, const char* synopsis, const char* value);
  14. const char* name() const;
  15. const char* synopsis() const;
  16. const char* value() const;
  17. StringSetting& operator=(const char* value);
  18. public:
  19. /// Returns the setting @name or NULL if not found.
  20. static StringSetting* find_setting(const char* name);
  21. private:
  22. const char* m_name;
  23. const char* m_synopsis;
  24. const char* m_value;
  25. StringSetting* m_next;
  26. };
  27. } // namespace crown