summaryrefslogtreecommitdiffstats
path: root/src/core/config/boolean.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/config/boolean.hh')
-rw-r--r--src/core/config/boolean.hh25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/config/boolean.hh b/src/core/config/boolean.hh
new file mode 100644
index 0000000..cfd8b0b
--- /dev/null
+++ b/src/core/config/boolean.hh
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "core/config/ivalue.hh"
+
+namespace config
+{
+class Boolean : public IValue {
+public:
+ explicit Boolean(bool default_value = false);
+ virtual ~Boolean(void) = default;
+
+ virtual void set(std::string_view value) override;
+ virtual std::string_view get(void) const override;
+
+ bool get_value(void) const;
+ void set_value(bool value);
+
+private:
+ bool m_value;
+
+public:
+ static std::string_view to_string(bool value);
+ static bool from_string(std::string_view value);
+};
+} // namespace config