--- parser3/src/include/pa_charset.h 2002/01/25 09:32:06 1.10 +++ parser3/src/include/pa_charset.h 2002/08/01 11:26:46 1.17 @@ -1,15 +1,15 @@ /** @file Parser: Charset connection decl. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) - - $Id: pa_charset.h,v 1.10 2002/01/25 09:32:06 paf Exp $ + Copyright (c) 2001, 2002 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="$Id: pa_charset.h,v 1.17 2002/08/01 11:26:46 paf Exp $"; + #include "pa_pool.h" #include "pa_exception.h" #include "pa_common.h" @@ -30,7 +30,7 @@ namespace PCRE { typedef unsigned int XMLCh; # endif # ifndef XMLByte -# typedef unsigned char XMLByte; + typedef unsigned char XMLByte; # endif struct Charset_TransRec { @@ -75,6 +75,7 @@ private: void transcodeFromUTF8(Pool& pool, const void *source_body, size_t source_content_length, const void *& dest_body, size_t& dest_content_length) const; + void transcodeToCharset(Pool& pool, const Charset& dest_transcoder, const void *source_body, size_t source_content_length, @@ -109,8 +110,12 @@ public: const char *transcode_cstr(xmlChar *s); /// converts xmlChar* null-terminated string to parser String String& transcode(xmlChar *s); + /** converts sized char * to xmlChar* + @returns xmlChar * which caller should free + */ + xmlChar *transcode_buf2xchar(const char *buf, size_t buf_size); /// converts char * to GdomeDOMString - GdomeDOMString_auto_ptr transcode_buf(const char *buf, size_t buf_size); + GdomeDOMString_auto_ptr transcode_buf2dom(const char *buf, size_t buf_size); /// converts parser String to GdomeDOMString GdomeDOMString_auto_ptr transcode(const String& s); @@ -122,6 +127,7 @@ private: }; +#ifdef XML /// Auto-object used to track GdomeDOMString usage class GdomeDOMString_auto_ptr { GdomeDOMString *fstring; @@ -158,5 +164,6 @@ public: return *this; } }; +#endif #endif