summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-06-16 09:52:40 +0200
committerlouiz’ <louiz@louiz.org>2017-06-16 09:54:36 +0200
commit40db183e3753486deaa43e950fff38579c5ced6f (patch)
tree8adfbb7649034d3ddc3290b825968442e09cad00 /src/utils
parent4a963cc480bb5a78e20380131ba886a7a23b0782 (diff)
downloadbiboumi-40db183e3753486deaa43e950fff38579c5ced6f.tar.gz
biboumi-40db183e3753486deaa43e950fff38579c5ced6f.tar.bz2
biboumi-40db183e3753486deaa43e950fff38579c5ced6f.tar.xz
biboumi-40db183e3753486deaa43e950fff38579c5ced6f.zip
Using OptionalBool, add RecordHistoryOptional col into IrcChannelOptions table
ref #3269
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/optional_bool.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/utils/optional_bool.hpp b/src/utils/optional_bool.hpp
new file mode 100644
index 0000000..824e76d
--- /dev/null
+++ b/src/utils/optional_bool.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <string>
+
+struct OptionalBool
+{
+ OptionalBool() = default;
+
+ OptionalBool(bool value):
+ is_set(true), value(value) {}
+
+ void set_value(bool value)
+ {
+ this->is_set = true;
+ this->value = value;
+ }
+
+ void unset()
+ {
+ this->is_set = false;
+ }
+
+ bool is_set{false};
+ bool value{false};
+};