summaryrefslogtreecommitdiff
path: root/louloulibs
diff options
context:
space:
mode:
Diffstat (limited to 'louloulibs')
-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 */