--- parser3/src/include/pa_charset.h 2003/09/25 09:15:02 1.24 +++ parser3/src/include/pa_charset.h 2004/02/11 15:33:13 1.29 @@ -1,14 +1,14 @@ /** @file Parser: Charset connection decl. - Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_CHARSET_H #define PA_CHARSET_H -static const char* IDENT_CHARSET_H="$Date: 2003/09/25 09:15:02 $"; +static const char * const IDENT_CHARSET_H="$Date: 2004/02/11 15:33:13 $"; #include "pa_exception.h" @@ -24,6 +24,7 @@ namespace PCRE { #ifdef XML #include "libxml/encoding.h" +#include "gdome.h" #endif // defines @@ -45,11 +46,6 @@ class GdomeDOMString_auto_ptr; // helpers -struct Charset_TransRec { - XMLCh intCh; - XMLByte extCh; -}; - typedef Hash HashStringString; /** charset holds name & transcode tables @@ -107,11 +103,25 @@ private: public: struct Tables { + struct Rec { + XMLCh intCh; + XMLByte extCh; + }; + XMLCh fromTable[0x100]; - Charset_TransRec toTable[MAX_CHARSET_UNI_CODES]; + Rec toTable[MAX_CHARSET_UNI_CODES]; uint toTableSize; }; + struct UTF8CaseTable { + struct Rec { + XMLCh from, to; + }; + + uint size; + Rec* records; + }; + private: const String::Body FNAME; @@ -154,6 +164,16 @@ private: }; + +// externs + +extern Charset::UTF8CaseTable UTF8CaseToUpper; +extern Charset::UTF8CaseTable UTF8CaseToLower; +void change_case_UTF8(const XMLByte* srcData, size_t srcLen, + XMLByte* toFill, size_t toFillLen, + const Charset::UTF8CaseTable& table); + + #ifdef XML /// Auto-object used to track GdomeDOMString usage class GdomeDOMString_auto_ptr {