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