summaryrefslogtreecommitdiff
path: root/src/helpers/MiscFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
-rw-r--r--src/helpers/MiscFunctions.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 489fa02a..bf8724c6 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -1,5 +1,6 @@
#include "MiscFunctions.hpp"
#include "../defines.hpp"
+#include <algorithm>
void addWLSignal(wl_signal* pSignal, wl_listener* pListener, void* pOwner, std::string ownerString) {
ASSERT(pSignal);
@@ -111,4 +112,12 @@ float getPlusMinusKeywordResult(std::string source, float relative) {
}
return result;
+}
+
+bool isNumber(const std::string& str) {
+ return std::ranges::all_of(str.begin(), str.end(), [](char c) { return isdigit(c) != 0; });
+}
+
+bool isDirection(const std::string& arg) {
+ return arg == "l" || arg == "r" || arg == "u" || arg == "d" || arg == "t" || arg == "b";
} \ No newline at end of file