--- parser3/src/include/pa_string.h 2001/07/07 17:59:02 1.97 +++ parser3/src/include/pa_string.h 2001/09/21 15:35:45 1.104 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.h,v 1.97 2001/07/07 17:59:02 parser Exp $ + $Id: pa_string.h,v 1.104 2001/09/21 15:35:45 parser Exp $ */ #ifndef PA_STRING_H @@ -57,6 +57,7 @@ class Table; class Array; class SQL_Connection; +class Dictionary; /** Pooled string. @@ -98,13 +99,14 @@ public: just a flag, that value not stored */ UL_AS_IS, ///< leave all characters intact - UL_FILE_NAME, ///< filename + UL_FILE_SPEC, ///< file specification UL_HTTP_HEADER, ///< text in HTTP response header UL_MAIL_HEADER, ///< text in mail header UL_URI, ///< text in uri UL_TABLE, ///< ^table:set body UL_SQL, ///< ^table:sql body UL_JS, ///< JavaScript code + UL_XML, ///< ^dom:set xml UL_HTML, ///< HTML code (for editing) UL_USER_HTML ///< HTML code with USER chars }; @@ -114,6 +116,8 @@ public: String(Pool& apool, const char *src=0, size_t src_size=0, bool tainted=false); String(const String& src); size_t size() const { return fsize; } + /// makes store_to produce origin:text\n output + void set_origins_mode(bool aorigins_mode) const { forigins_mode=aorigins_mode; } /// convert to C string. if 'lang' known, forcing 'lang' to it char *cstr(Untaint_lang lang=UL_UNSPECIFIED, SQL_Connection *connection=0, @@ -178,6 +182,9 @@ public: /// simple hash code of string. used by Hash uint hash_code() const; + /// extracts first char of a string + char first_char() const; + /// extracts [start, finish) piece of string String& mid(size_t start, size_t finish) const; @@ -211,13 +218,15 @@ public: const String& regexp, const String *options, Table **table, - Row_action row_action, void *info) const; + Row_action row_action, void *info, + bool *was_global=0) const; enum Change_case_kind { CC_UPPER, CC_LOWER }; String& change_case(Pool& pool, const unsigned char *pcre_tables, Change_case_kind kind) const; + String& replace(Pool& pool, Dictionary& dict) const; double as_double() const; int as_int() const; @@ -266,6 +275,9 @@ private: // used rows in all chunks int fused_rows; + /// origins_mode changes behaviour of store_to[cstr()] + mutable bool forigins_mode; + private: bool chunk_is_full() {