From 8aad995e32bfdfd31cbd811f65c5c986f2b9be70 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 24 Apr 2010 07:31:58 +0000 Subject: (svn r19703) -Add: hexadecimal string filter --- src/string.cpp | 1 + src/string_type.h | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/string.cpp b/src/string.cpp index 16e1e7099..58ac00a6c 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -202,6 +202,7 @@ bool IsValidChar(WChar key, CharSetFilter afilter) case CS_NUMERAL: return (key >= '0' && key <= '9'); case CS_NUMERAL_SPACE: return (key >= '0' && key <= '9') || key == ' '; case CS_ALPHA: return IsPrintable(key) && !(key >= '0' && key <= '9'); + case CS_HEXADECIMAL: return (key >= '0' && key <= '9') || (key >= 'a' && key <= 'f') || (key >= 'A' && key <= 'F'); } return false; diff --git a/src/string_type.h b/src/string_type.h index 40c1e2dc7..2fb8d8f57 100644 --- a/src/string_type.h +++ b/src/string_type.h @@ -20,6 +20,7 @@ enum CharSetFilter { CS_NUMERAL, ///< Only numeric ones CS_NUMERAL_SPACE, ///< Only numbers and spaces CS_ALPHA, ///< Only alphabetic values + CS_HEXADECIMAL, ///< Only hexadecimal characters }; typedef uint32 WChar; -- cgit v1.2.3-70-g09d2