summaryrefslogtreecommitdiff
path: root/src/string.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-09-30 16:23:18 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-09-30 16:23:18 +0200
commit430765e1323398e7540ed49fa9cc1d8d5c134c3f (patch)
treedc95bfd7fcaad921de437d12e44b09243e15b86d /src/string.hh
parent801e3eaae25964dd297c3ffeb00fc28475e3da86 (diff)
extract is_alpha to string.hh
Diffstat (limited to 'src/string.hh')
-rw-r--r--src/string.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/string.hh b/src/string.hh
index 8676c5da..2e8172c1 100644
--- a/src/string.hh
+++ b/src/string.hh
@@ -119,6 +119,14 @@ String int_to_str(int value);
int str_to_int(const String& str);
std::vector<String> split(const String& str, Character separator);
+inline bool is_word(Character c)
+{
+ return (c >= '0' and c <= '9') or
+ (c >= 'a' and c <= 'z') or
+ (c >= 'A' and c <= 'Z') or
+ c == '_';
+}
+
}
namespace std