From 36c6c87fe4380b214f8ff8a45dc0213fa109821c Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 24 Aug 2015 17:52:52 +0300 Subject: fix compile issues with external libarries --- external_libs/cpp/yaml-cpp/src/conversion.cpp | 89 +++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 external_libs/cpp/yaml-cpp/src/conversion.cpp (limited to 'external_libs/cpp/yaml-cpp/src/conversion.cpp') diff --git a/external_libs/cpp/yaml-cpp/src/conversion.cpp b/external_libs/cpp/yaml-cpp/src/conversion.cpp new file mode 100755 index 00000000..f81e1a0b --- /dev/null +++ b/external_libs/cpp/yaml-cpp/src/conversion.cpp @@ -0,0 +1,89 @@ +#include "yaml-cpp/conversion.h" +#include + +//////////////////////////////////////////////////////////////// +// Specializations for converting a string to specific types + +namespace +{ + // we're not gonna mess with the mess that is all the isupper/etc. functions + bool IsLower(char ch) { return 'a' <= ch && ch <= 'z'; } + bool IsUpper(char ch) { return 'A' <= ch && ch <= 'Z'; } + char ToLower(char ch) { return IsUpper(ch) ? ch + 'a' - 'A' : ch; } + + std::string tolower(const std::string& str) + { + std::string s(str); + std::transform(s.begin(), s.end(), s.begin(), ToLower); + return s; + } + + template + bool IsEntirely(const std::string& str, T func) + { + for(std::size_t i=0;i