From 1691cf8f64d6175c61ddf9a4f4a95b44c32d698e Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Fri, 18 Sep 2015 22:01:02 +0200 Subject: Introduce the configure ad-hoc command on irc servers Provides two options for now, and they have no effect yet --- louloulibs/utils/string.cpp | 6 ++++++ louloulibs/utils/string.hpp | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 louloulibs/utils/string.cpp create mode 100644 louloulibs/utils/string.hpp (limited to 'louloulibs') 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 + +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 + +bool to_bool(const std::string& val); + +#endif /* STRING_UTILS_HPP_INCLUDED */ -- cgit v1.2.3