--- parser3/src/include/pa_string.h 2004/05/24 12:21:18 1.162 +++ parser3/src/include/pa_string.h 2005/11/22 15:09:10 1.166 @@ -1,17 +1,16 @@ /** @file Parser: string class decl. - Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_STRING_H #define PA_STRING_H -static const char * const IDENT_STRING_H="$Date: 2004/05/24 12:21:18 $"; +static const char * const IDENT_STRING_H="$Date: 2005/11/22 15:09:10 $"; // includes - #include "pa_types.h" #include "pa_array.h" @@ -20,6 +19,8 @@ extern "C" { // cord's author forgot to #include "cord.h" }; +// defines + // cord extension /* Returns true if x does contain */ /* char not_c at positions i..i+n. Value i,i+n must be < CORD_len(x). */ @@ -90,11 +91,11 @@ public: L_HTTP_HEADER='h', ///< text in HTTP response header L_MAIL_HEADER='m', ///< text in mail header L_URI='U', ///< text in uri - L_TABLE='L', ///< ^table:set body L_SQL='Q', ///< ^table:sql body L_JS='J', ///< JavaScript code L_XML='X', ///< ^dom:set xml - L_HTML='H', ///< HTML code (for editing) + L_HTML='H', ///< HTML code + L_REGEX='R', ///< RegEx expression // READ WARNING ABOVE BEFORE ADDING ANYTHING L_OPTIMIZE_BIT = 0x80 ///< flag, requiring cstr whitespace optimization }; @@ -153,6 +154,7 @@ public: public: const char* v() const; + void dump() const; Languages(): langs(0) {} Languages(Language alang) { @@ -241,7 +243,7 @@ public: callback(opt.lang, get_length(current), info); } - bool invariant(size_t current_length) { + bool invariant(size_t current_length) const { if(!langs) return current_length==0; if(opt.is_not_just_lang) @@ -257,6 +259,7 @@ public: public: const char* v() const; + void dump() const; Body(): body(CORD_EMPTY) {} Body(CORD abody): body(abody) { @@ -374,9 +377,9 @@ private: Languages langs; ///< string characters lang const char* v() const; - -#define ASSERT_STRING_INVARIANT(string) \ - assert((string).langs.invariant((string).body.length())) + void dump() const; + #define ASSERT_STRING_INVARIANT(string) \ + assert((string).langs.invariant((string).body.length())) public: