mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(svn r19703) -Add: hexadecimal string filter
This commit is contained in:
parent
d8c2c261c0
commit
dcf7d2de54
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user