|
|
| version 1.24, 2003/09/25 09:15:02 | version 1.30, 2004/02/18 12:46:49 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: Charset connection decl. | 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 <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| #ifndef PA_CHARSET_H | #ifndef PA_CHARSET_H |
| #define PA_CHARSET_H | #define PA_CHARSET_H |
| static const char* IDENT_CHARSET_H="$Date$"; | static const char * const IDENT_CHARSET_H="$Date$"; |
| #include "pa_exception.h" | #include "pa_exception.h" |
| Line 24 namespace PCRE { | Line 24 namespace PCRE { |
| #ifdef XML | #ifdef XML |
| #include "libxml/encoding.h" | #include "libxml/encoding.h" |
| #include "gdome.h" | |
| #endif | #endif |
| // defines | // defines |
| Line 45 class GdomeDOMString_auto_ptr; | Line 46 class GdomeDOMString_auto_ptr; |
| // helpers | // helpers |
| struct Charset_TransRec { | |
| XMLCh intCh; | |
| XMLByte extCh; | |
| }; | |
| typedef Hash<const String::Body, String::Body> HashStringString; | typedef Hash<const String::Body, String::Body> HashStringString; |
| /** charset holds name & transcode tables | /** charset holds name & transcode tables |
| Line 61 public: | Line 57 public: |
| Charset(Request_charsets* charsets, const String::Body ANAME, const String* afile_spec); | Charset(Request_charsets* charsets, const String::Body ANAME, const String* afile_spec); |
| const String::Body NAME() const { return FNAME; } | const String::Body NAME() const { return FNAME; } |
| const char* NAME_CSTR() const { return FNAME_CSTR; } | |
| bool isUTF8() const { return fisUTF8; } | bool isUTF8() const { return fisUTF8; } |
| Line 107 private: | Line 104 private: |
| public: | public: |
| struct Tables { | struct Tables { |
| struct Rec { | |
| XMLCh intCh; | |
| XMLByte extCh; | |
| }; | |
| XMLCh fromTable[0x100]; | XMLCh fromTable[0x100]; |
| Charset_TransRec toTable[MAX_CHARSET_UNI_CODES]; | Rec toTable[MAX_CHARSET_UNI_CODES]; |
| uint toTableSize; | uint toTableSize; |
| }; | }; |
| struct UTF8CaseTable { | |
| struct Rec { | |
| XMLCh from, to; | |
| }; | |
| uint size; | |
| Rec* records; | |
| }; | |
| private: | private: |
| const String::Body FNAME; | const String::Body FNAME; |
| Line 154 private: | Line 165 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 | #ifdef XML |
| /// Auto-object used to track GdomeDOMString usage | /// Auto-object used to track GdomeDOMString usage |
| class GdomeDOMString_auto_ptr { | class GdomeDOMString_auto_ptr { |