1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 01:19:11 +00:00

(svn r19703) -Add: hexadecimal string filter

This commit is contained in:
rubidium
2010-04-24 07:31:58 +00:00
parent cdfd81405e
commit 8aad995e32
2 changed files with 2 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;