--- parser3/src/include/pa_string.h 2001/10/29 16:29:07 1.112 +++ parser3/src/include/pa_string.h 2001/11/16 12:38:43 1.116 @@ -2,9 +2,9 @@ Parser: string class decl. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: pa_string.h,v 1.112 2001/10/29 16:29:07 paf Exp $ + $Id: pa_string.h,v 1.116 2001/11/16 12:38:43 paf Exp $ */ #ifndef PA_STRING_H @@ -16,15 +16,6 @@ class Table; -/** - $MAIN:html-typo table elements must enlarge string not more that that. - - that's a tradeoff - otherwise we'd have to scan string twice: - - first for buffer length - - second for replacements themselves -*/ -#define UNTAINT_TIMES_BIGGER 10 - #ifndef NO_STRING_ORIGIN # define STRING_APPEND_PARAMS \ const char *src, size_t size, \ @@ -78,6 +69,7 @@ class Dictionary; - whether they are tainted or not, and the language which should be used to detaint them */ +#include "pa_pragma_pack_begin.h" class String : public Pooled { public: @@ -109,7 +101,7 @@ public: UL_JS, ///< JavaScript code UL_XML, ///< ^dom:set xml UL_HTML, ///< HTML code (for editing) - UL_USER_HTML ///< HTML code with USER chars + UL_OPTIMIZED_HTML ///< optimized HTML code, adjucent whitespaces joined }; public: @@ -124,7 +116,7 @@ public: SQL_Connection *connection=0, const char *charset=0) const { - char *result=(char *)malloc(cstr_bufsize(lang)); + char *result=(char *)malloc(cstr_bufsize(lang, connection, charset)); char *eol=store_to(result, lang, connection, charset); *eol=0; return result; @@ -173,7 +165,6 @@ public: return cmp(partial, src_ptr, 0)!=0; } - /** appends other String. @@ -251,7 +242,7 @@ private: struct { const char *ptr; ///< pointer to the start size_t size; ///< length - Untaint_lang lang; ///< untaint flag, later untaint language + unsigned char/*Untaint_lang*/ lang; ///< untaint flag, later untaint language #ifndef NO_STRING_ORIGIN Origin origin; ///< origin #endif @@ -288,7 +279,9 @@ private: uint used_rows() const; void expand(); - size_t cstr_bufsize(Untaint_lang lang) const; + size_t cstr_bufsize(Untaint_lang lang, + SQL_Connection *connection, + const char *charset) const; /// convert to C string, store to 'dest' which must be big enough for proper untaint char *store_to(char *dest, Untaint_lang lang=UL_UNSPECIFIED, SQL_Connection *connection=0, @@ -305,5 +298,6 @@ private: //disabled String& operator = (const String&) { return *this; } }; +#include "pa_pragma_pack_end.h" #endif