--- parser3/src/include/pa_string.h 2002/08/08 08:43:38 1.142 +++ parser3/src/include/pa_string.h 2003/01/22 15:39:07 1.144.2.1 @@ -1,14 +1,14 @@ /** @file Parser: string class 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) */ #ifndef PA_STRING_H #define PA_STRING_H -static const char* IDENT_STRING_H="$Date: 2002/08/08 08:43:38 $"; +static const char* IDENT_STRING_H="$Date: 2003/01/22 15:39:07 $"; #include "pa_pool.h" #include "pa_types.h" @@ -68,7 +68,7 @@ class Dictionary; and the language which should be used to detaint them */ #include "pa_pragma_pack_begin.h" -class String : public Pooled { +class String: public PA_Object { public: enum { @@ -106,11 +106,12 @@ public: public: - static String& OnPool(Pool& apool, const char *local_src=0, size_t src_size=0, bool tainted=false); - String(Pool& apool, const char *src=0, size_t src_size=0, bool tainted=false); + //static String& OnPool(Pool& apool, const char *local_src=0, size_t src_size=0, bool tainted=false); + String(const char *src=0, size_t src_size=0, bool tainted=false); String(const String& src); + ~String(); bool is_empty() const { return append_here==head.chunk.rows; } - size_t size() const; + size_t size() const; /// @todonow make it field /// convert to C string. if 'lang' known, forcing 'lang' to it char *cstr(Untaint_lang lang=UL_AS_IS, SQL_Connection *connection=0, @@ -180,7 +181,7 @@ public: /// extracts first char of a string, if any char first_char() const { - return is_empty()?*head.chunk.rows[0].item.ptr:0; + return is_empty()?0:*head.chunk.rows[0].item.ptr; } /// extracts [start, finish) piece of string @@ -213,7 +214,7 @@ public: prematch/match/postmatch/1/2/3/... @endverbatim */ - bool match( + bool match(Charset& source_charset, const String *aorigin, const String& regexp, const String *options, @@ -224,13 +225,13 @@ public: CC_UPPER, CC_LOWER }; - String& change_case(Pool& pool, + String& change_case(Charset& source_charset, Change_case_kind kind) const; - String& replace(Pool& pool, Dictionary& dict) const; + String& replace(Dictionary& dict) const; double as_double() const; int as_int() const; - String& join_chains(Pool& pool, char** cstr) const; + String& join_chains(char** cstr) const; #ifndef NO_STRING_ORIGIN /// origin of string. calculated by first row @@ -297,7 +298,7 @@ private: Charset *store_to_charset=0, const char *store_to_charset_name=0) const; - void join_chain(Pool& pool, + void join_chain( const Chunk*& achunk, const Chunk::Row*& arow, uint& acountdown, uchar& joined_lang, const char *& joined_ptr, size_t& joined_size) const;