From b31ad140a77e6dc8a103d158200ae4e34c9967eb Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Wed, 14 Apr 2021 20:20:55 +0200 Subject: [PATCH] Added a header for text handling in ascii --- include/gp/text/ascii.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 include/gp/text/ascii.hpp diff --git a/include/gp/text/ascii.hpp b/include/gp/text/ascii.hpp new file mode 100644 index 0000000..1da47a5 --- /dev/null +++ b/include/gp/text/ascii.hpp @@ -0,0 +1,13 @@ +#pragma once + +inline bool is_digit(char v) { + return v >= '0' && v <= '9'; +} + +inline bool is_alpha(char v) { + return (v >= 'a' && v <= 'z' )||(v >= 'A' && v <= 'Z'); +} + +inline bool is_alnum(char v) { + return is_alpha(v) || is_digit(v); +} \ No newline at end of file