summaryrefslogtreecommitdiff
path: root/src/CommonAPI/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/utils.h')
-rw-r--r--src/CommonAPI/utils.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/CommonAPI/utils.h b/src/CommonAPI/utils.h
index 7717103..2dccfcc 100644
--- a/src/CommonAPI/utils.h
+++ b/src/CommonAPI/utils.h
@@ -109,6 +109,10 @@ inline void trim(std::string& toTrim) {
);
}
+inline bool notIsdigit(char c) {
+ return !std::isdigit(c);
+}
+
/**
* \brief Checks whether the given string contains nothing but digits.
*
@@ -120,13 +124,15 @@ inline bool containsOnlyDigits(const std::string& toCheck) {
auto firstNonDigitIt = std::find_if(
toCheck.begin(),
toCheck.end(),
- [](char c) {
- return !std::isdigit(c);
- });
+ notIsdigit);
return firstNonDigitIt == toCheck.end();
}
+inline bool notIsalnum(char c) {
+ return !std::isalnum(c);
+}
+
/**
* \brief Checks whether the given string contains nothing but alphanumeric characters.
*
@@ -138,9 +144,7 @@ inline bool containsOnlyAlphanumericCharacters(const std::string& toCheck) {
auto firstNonAlphanumericCharacterIt = std::find_if(
toCheck.begin(),
toCheck.end(),
- [](char c) {
- return !std::isalnum(c);
- });
+ notIsalnum);
return firstNonAlphanumericCharacterIt == toCheck.end();
}