diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:14 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:14 +0200 |
commit | 01eb8253196672c969a39587e90b49321a182428 (patch) | |
tree | 4a3b71d7913de519744466c9227fda6461c4f0b5 /lib/parse_lng.h | |
parent | 5.0 (diff) | |
download | FreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.gz FreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.bz2 FreeFileSync-01eb8253196672c969a39587e90b49321a182428.zip |
5.1
Diffstat (limited to 'lib/parse_lng.h')
-rw-r--r-- | lib/parse_lng.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/parse_lng.h b/lib/parse_lng.h index e876c5a9..07932c3a 100644 --- a/lib/parse_lng.h +++ b/lib/parse_lng.h @@ -213,15 +213,6 @@ private: TokenMap tokens; }; -struct IsWhiteSpace : public std::unary_function<char, bool> -{ - bool operator()(char c) const - { - const unsigned char usc = c; //caveat 1: std::isspace() takes an int, but expects an unsigned char - return usc < 128 && //caveat 2: some parts of UTF-8 chars are erroneously seen as whitespace, e.g. the a0 from "\xec\x8b\a0" (MSVC) - std::isspace(usc) != 0; //[!] - } -}; class Scanner { @@ -231,7 +222,7 @@ public: Token nextToken() { //skip whitespace - pos = std::find_if(pos, stream.end(), std::not1(IsWhiteSpace())); + pos = std::find_if(pos, stream.end(), [](char c) { return !zen::isWhiteSpace(c); }); if (pos == stream.end()) return Token(Token::TK_END); @@ -289,7 +280,7 @@ private: static void normalize(std::string& text) { //remmove whitespace from end - while (!text.empty() && IsWhiteSpace()(*text.rbegin())) + while (!text.empty() && zen::isWhiteSpace(*text.rbegin())) text.resize(text.size() - 1); //ensure c-style line breaks |