From 68ae3c4fd9db8baef4fea99d91766af5bc210506 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 5 Feb 2015 02:46:00 +0100 Subject: Added hasNonWhitepaceChar function --- src/core/common/Utils.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/core/common/Utils.cpp') diff --git a/src/core/common/Utils.cpp b/src/core/common/Utils.cpp index f59061a..e5e2d39 100644 --- a/src/core/common/Utils.cpp +++ b/src/core/common/Utils.cpp @@ -46,6 +46,16 @@ bool Utils::isIdentifier(const std::string &name) return true; } +bool Utils::hasNonWhitepaceChar(const std::string &s) +{ + for (char c : s) { + if (!isWhitespace(c)) { + return true; + } + } + return false; +} + std::vector Utils::split(const std::string &s, char delim) { std::vector res; @@ -84,6 +94,5 @@ std::string Utils::extractFileExtension(const std::string &filename) } return std::string{}; } - } -- cgit v1.2.3