diff options
author | Yuri Gorshenin <y@maps.me> | 2017-06-01 16:12:59 +0300 |
---|---|---|
committer | Yuri Gorshenin <y@maps.me> | 2017-06-01 16:12:59 +0300 |
commit | d95de0e1ecc1c509ca06063f9436c7b7bcc0256d (patch) | |
tree | 22610badafa27da2ca9cc59398bf51c21e80282c /base | |
parent | 08b0166a665ab98bfaf1273df9aa6911387abc09 (diff) |
Review fixes.
Diffstat (limited to 'base')
-rw-r--r-- | base/string_utils.cpp | 6 | ||||
-rw-r--r-- | base/string_utils.hpp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/base/string_utils.cpp b/base/string_utils.cpp index f2546161fb..f90c24e7f8 100644 --- a/base/string_utils.cpp +++ b/base/string_utils.cpp @@ -236,6 +236,12 @@ bool IsASCIIString(std::string const & str) } bool IsASCIIDigit(UniChar c) { return c >= '0' && c <= '9'; } + +bool IsASCIISpace(UniChar c) +{ + return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v'; +} + bool IsASCIILatin(UniChar c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } bool StartsWith(UniString const & s, UniString const & p) diff --git a/base/string_utils.hpp b/base/string_utils.hpp index 1ebec6dc13..3e353fd3ac 100644 --- a/base/string_utils.hpp +++ b/base/string_utils.hpp @@ -88,6 +88,7 @@ UniString MakeUniString(std::string const & utf8s); std::string ToUtf8(UniString const & s); bool IsASCIIString(std::string const & str); bool IsASCIIDigit(UniChar c); +bool IsASCIISpace(UniChar c); bool IsASCIILatin(UniChar c); inline std::string DebugPrint(UniString const & s) { return ToUtf8(s); } |