aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-22 11:28:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-09-22 11:28:33 +0200
commite53da6ae4665ce49dddcc9aaa97a4e87bb94f48d (patch)
treeda485cc9a0ce71c02d35ecb38ca9212967702512
parent967d8fcc476c5754bcc365dc6a64e6023f0b8af1 (diff)
Add wspace(char) utility function
-rw-r--r--libbutl/utility.hxx2
-rw-r--r--libbutl/utility.ixx12
2 files changed, 14 insertions, 0 deletions
diff --git a/libbutl/utility.hxx b/libbutl/utility.hxx
index 95a7f78..e284fa6 100644
--- a/libbutl/utility.hxx
+++ b/libbutl/utility.hxx
@@ -132,11 +132,13 @@ namespace butl
bool digit (char);
bool alnum (char);
bool xdigit (char);
+ bool wspace (char);
bool alpha (wchar_t);
bool digit (wchar_t);
bool alnum (wchar_t);
bool xdigit (wchar_t);
+ bool wspace (wchar_t);
// Basic string utilities.
//
diff --git a/libbutl/utility.ixx b/libbutl/utility.ixx
index 4180ad7..45bbf9d 100644
--- a/libbutl/utility.ixx
+++ b/libbutl/utility.ixx
@@ -143,6 +143,12 @@ namespace butl
}
inline bool
+ wspace (char c)
+ {
+ return std::isspace (c);
+ }
+
+ inline bool
alpha (wchar_t c)
{
return std::iswalpha (c);
@@ -166,6 +172,12 @@ namespace butl
return std::iswxdigit (c);
}
+ inline bool
+ wspace (wchar_t c)
+ {
+ return std::iswspace (c);
+ }
+
inline std::size_t
next_word (const std::string& s, std::size_t& b, std::size_t& e,
char d1, char d2)