--- parser3/src/include/pa_string.h 2001/11/19 12:17:06 1.119 +++ parser3/src/include/pa_string.h 2002/02/08 08:30:14 1.124 @@ -1,16 +1,15 @@ /** @file Parser: string class decl. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) + Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) - $Id: pa_string.h,v 1.119 2001/11/19 12:17:06 paf Exp $ + $Id: pa_string.h,v 1.124 2002/02/08 08:30:14 paf Exp $ */ #ifndef PA_STRING_H #define PA_STRING_H -#include "pa_config_includes.h" #include "pa_pool.h" #include "pa_types.h" @@ -83,15 +82,17 @@ public: */ enum Untaint_lang { UL_UNSPECIFIED=0, ///< zero value handy for hash lookup @see untaint_lang_name2enum + // these two must go before others, there are checks for >UL_AS_IS UL_CLEAN, ///< clean - UL_TAINTED, ///< tainted, untaint language as assigned later - // untaint languages. assigned by ^untaint[lang]{...} + UL_AS_IS, ///< leave all characters intact + UL_PASS_APPENDED, /**< leave language built into string being appended. just a flag, that value not stored */ - UL_AS_IS, ///< leave all characters intact + UL_TAINTED, ///< tainted, untaint language as assigned later + // untaint languages. assigned by ^untaint[lang]{...} UL_FILE_SPEC, ///< file specification UL_HTTP_HEADER, ///< text in HTTP response header UL_MAIL_HEADER, ///< text in mail header @@ -112,10 +113,10 @@ public: /// convert to C string. if 'lang' known, forcing 'lang' to it char *cstr(Untaint_lang lang=UL_AS_IS, SQL_Connection *connection=0, - const char *charset=0) const { + Charset *cstr_charset=0) const { - char *result=(char *)malloc(cstr_bufsize(lang, connection, charset)); - char *eol=store_to(result, lang, connection, charset); + char *result=(char *)malloc(cstr_bufsize(lang, connection, cstr_charset)); + char *eol=store_to(result, lang, connection, cstr_charset); *eol=0; return result; } @@ -208,7 +209,7 @@ public: prematch/match/postmatch/1/2/3/... @endverbatim */ - bool match(const unsigned char *pcre_tables, + bool match( const String *aorigin, const String& regexp, const String *options, @@ -219,7 +220,7 @@ public: CC_UPPER, CC_LOWER }; - String& change_case(Pool& pool, const unsigned char *pcre_tables, + String& change_case(Pool& pool, Change_case_kind kind) const; String& replace(Pool& pool, Dictionary& dict) const; double as_double() const; @@ -274,11 +275,11 @@ private: size_t cstr_bufsize(Untaint_lang lang, SQL_Connection *connection, - const char *charset) const; + Charset *buf_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, - const char *charset=0) const; + Charset *store_to_charset=0) const; String& reconstruct(Pool& pool) const; void join_chain(Pool& pool,