From 0ab40dc1ab4e689921da54080b135e1d22b1c586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 14 Mar 2017 21:45:23 +0100 Subject: Refactoring louloulibs and cmake Use OBJECT libraries Remove the louloulibs directory Write FOUND variables in the cache --- louloulibs/utils/string.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 louloulibs/utils/string.cpp (limited to 'louloulibs/utils/string.cpp') diff --git a/louloulibs/utils/string.cpp b/louloulibs/utils/string.cpp deleted file mode 100644 index 635e71a..0000000 --- a/louloulibs/utils/string.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -bool to_bool(const std::string& val) -{ - return (val == "1" || val == "true"); -} - -std::vector cut(const std::string& val, const std::size_t size) -{ - std::vector res; - std::string::size_type pos = 0; - while (pos < val.size()) - { - // Get the number of chars, <= size, that contain only whole - // UTF-8 codepoints. - std::size_t s = 0; - auto codepoint_size = utils::get_next_codepoint_size(val[pos + s]); - while (s + codepoint_size <= size && pos + s < val.size()) - { - s += codepoint_size; - codepoint_size = utils::get_next_codepoint_size(val[pos + s]); - } - res.emplace_back(val.substr(pos, s)); - pos += s; - } - return res; -} -- cgit v1.2.3