Changeset - r15067:d55116170d15
[Not reviewed]
master
0 2 0
rubidium - 14 years ago 2010-04-24 07:31:58
rubidium@openttd.org
(svn r19703) -Add: hexadecimal string filter
2 files changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/string.cpp
Show inline comments
 
@@ -202,6 +202,7 @@ bool IsValidChar(WChar key, CharSetFilte
 
		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;
src/string_type.h
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)