From e53da6ae4665ce49dddcc9aaa97a4e87bb94f48d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Sep 2022 11:28:33 +0200 Subject: Add wspace(char) utility function --- libbutl/utility.hxx | 2 ++ libbutl/utility.ixx | 12 ++++++++++++ 2 files changed, 14 insertions(+) (limited to 'libbutl') 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) -- cgit v1.1