summaryrefslogtreecommitdiff
path: root/louloulibs/utils
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-09-18 22:01:02 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-09-18 22:09:26 +0200
commit1691cf8f64d6175c61ddf9a4f4a95b44c32d698e (patch)
tree34870be05030d00dfbaa2d1d12c0c9141dcfc223 /louloulibs/utils
parentf1de6d032091bd141e12e8345969495d6f23c3e6 (diff)
downloadbiboumi-1691cf8f64d6175c61ddf9a4f4a95b44c32d698e.tar.gz
biboumi-1691cf8f64d6175c61ddf9a4f4a95b44c32d698e.tar.bz2
biboumi-1691cf8f64d6175c61ddf9a4f4a95b44c32d698e.tar.xz
biboumi-1691cf8f64d6175c61ddf9a4f4a95b44c32d698e.zip
Introduce the configure ad-hoc command on irc servers
Provides two options for now, and they have no effect yet
Diffstat (limited to 'louloulibs/utils')
-rw-r--r--louloulibs/utils/string.cpp6
-rw-r--r--louloulibs/utils/string.hpp8
2 files changed, 14 insertions, 0 deletions
diff --git a/louloulibs/utils/string.cpp b/louloulibs/utils/string.cpp
new file mode 100644
index 0000000..3977feb
--- /dev/null
+++ b/louloulibs/utils/string.cpp
@@ -0,0 +1,6 @@
+#include <utils/string.hpp>
+
+bool to_bool(const std::string& val)
+{
+ return (val == "1" || val == "true");
+}
diff --git a/louloulibs/utils/string.hpp b/louloulibs/utils/string.hpp
new file mode 100644
index 0000000..3775c36
--- /dev/null
+++ b/louloulibs/utils/string.hpp
@@ -0,0 +1,8 @@
+#ifndef STRING_UTILS_HPP_INCLUDED
+#define STRING_UTILS_HPP_INCLUDED
+
+#include <string>
+
+bool to_bool(const std::string& val);
+
+#endif /* STRING_UTILS_HPP_INCLUDED */