- Optimization: common parameters to built in functions are no longer looked up as a string at each call, instead their integer ids are global constants

- Optimization: some other minor tweaks.
 - Nicer --help message

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@783 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-12-24 02:04:45 +00:00
parent b79f52db84
commit 547a48b98d
23 changed files with 232 additions and 134 deletions
+8 -1
View File
@@ -82,7 +82,6 @@ void writeUTF8(wxTextOutputStream& stream, const String& str);
// ----------------------------------------------------------------------------- : Char functions
// Character set tests
inline bool isSpace(Char c) { return IF_UNICODE( iswspace(c) , isspace((unsigned char)c) ) || c == CONNECTION_SPACE; }
inline bool isAlpha(Char c) { return IF_UNICODE( iswalpha(c) , isalpha((unsigned char)c) ); }
inline bool isDigit(Char c) { return IF_UNICODE( iswdigit(c) , isdigit((unsigned char)c) ); }
inline bool isAlnum(Char c) { return IF_UNICODE( iswalnum(c) , isalnum((unsigned char)c) ); }
@@ -98,9 +97,17 @@ inline bool isPunct(Char c) { return IF_UNICODE( iswpunct(c) , ispunct((unsigned
// If also in other compilers, they can also use these routines.
Char toLower(Char c);
Char toUpper(Char c);
inline bool isSpace(Char c) {
if (c <= 128) {
return (c >= 0x09 && c <= 0x0D) || c == 0x20;
} else {
return IF_UNICODE( iswspace(c) , isspace((unsigned char)c) ) || c == CONNECTION_SPACE;
}
}
#else
inline Char toLower(Char c) { return IF_UNICODE( towlower(c) , tolower(c) ); }
inline Char toUpper(Char c) { return IF_UNICODE( towupper(c) , toupper(c) ); }
inline bool isSpace(Char c) { return IF_UNICODE( iswspace(c) , isspace((unsigned char)c) ) || c == CONNECTION_SPACE; }
#endif
// ----------------------------------------------------------------------------- : String utilities