--- parser3/src/include/pa_charset.h 2002/06/28 09:59:00 1.16 +++ parser3/src/include/pa_charset.h 2003/01/27 15:35:24 1.20.2.2 @@ -1,15 +1,15 @@ /** @file Parser: Charset connection decl. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - - $Id: pa_charset.h,v 1.16 2002/06/28 09:59:00 paf Exp $ */ #ifndef PA_CHARSET_H #define PA_CHARSET_H +static const char* IDENT_CHARSET_H="$Date: 2003/01/27 15:35:24 $"; + #include "pa_pool.h" #include "pa_exception.h" #include "pa_common.h" @@ -41,17 +41,17 @@ struct Charset_TransRec { /** charset holds name & transcode tables registers Xerces transcoders */ -class Charset : public Pooled { +class Charset : public PA_Object { public: - Charset(Pool& apool, const String& aname, const String *request_file_spec); + Charset(Pool& pool, ConstStringPtr aname, ConstStringPtr afile_spec); Charset::~Charset(); - const String& name() const { return fname; } + ConstStringPtr name() const { return fname; } bool isUTF8() const { return fisUTF8; } - static void transcode(Pool& pool, + static void transcode(Pool& pool, const Charset& source_transcoder, const void *source_body, size_t source_content_length, const Charset& dest_transcoder, const void *& dest_body, size_t& dest_content_length ); @@ -66,7 +66,7 @@ public: private: - void loadDefinition(const String& request_file_spec); + void loadDefinition(Pool& pool, ConstStringPtr afile_spec); void sort_ToTable(); void transcodeToUTF8(Pool& pool, @@ -91,7 +91,8 @@ public: private: - const String& fname; + ConstStringPtr fname; + CharPtr fname_cstr; bool fisUTF8; Tables tables; @@ -105,11 +106,19 @@ public: /// converts GdomeDOMString string to char * const char *transcode_cstr(GdomeDOMString *s); /// converts GdomeDOMString string to parser String - String& transcode(GdomeDOMString *s); + String& transcode(GdomeDOMString *s +#ifndef NO_STRING_ORIGIN + , const String *origin +#endif + ); /// converts xmlChar* null-terminated string to char * const char *transcode_cstr(xmlChar *s); /// converts xmlChar* null-terminated string to parser String - String& transcode(xmlChar *s); + String& transcode(xmlChar *s +#ifndef NO_STRING_ORIGIN + , const String *origin +#endif + ); /** converts sized char * to xmlChar* @returns xmlChar * which caller should free */