Diff for /parser3/src/include/pa_string.h between versions 1.60 and 1.63

version 1.60, 2001/04/02 09:29:17 version 1.63, 2001/04/03 08:23:07
Line 18 Line 18
 #include "pa_pool.h"  #include "pa_pool.h"
 #include "pa_types.h"  #include "pa_types.h"
   
   class Table;
   
 /**  /**
         $MAIN:html-typo table elements must enlarge string not more that that          $MAIN:html-typo table elements must enlarge string not more that that
         that's a tradeoff - otherwise we'd have to scan string twice:          that's a tradeoff - otherwise we'd have to scan string twice:
Line 45 Line 47
 #endif  #endif
 /// appends clean piece to String  @see String::real_append  /// appends clean piece to String  @see String::real_append
 #define APPEND_CLEAN(src, size, file, line) \  #define APPEND_CLEAN(src, size, file, line) \
         APPEND(src, size, String::UL_NO, file, line)          APPEND(src, size, String::UL_CLEAN, file, line)
 /// appends tainted piece to String  @see String::real_append  /// appends tainted piece to String  @see String::real_append
 #define APPEND_TAINTED(src, size, file, line) \  #define APPEND_TAINTED(src, size, file, line) \
         APPEND(src, size, String::UL_YES, file, line)          APPEND(src, size, String::UL_TAINTED, file, line)
 /// handy: appends const char* piece to String  @see String::real_append  /// handy: appends const char* piece to String  @see String::real_append
 #define APPEND_CONST(src) APPEND_CLEAN(src, 0, 0, 0)  #define APPEND_CONST(src) APPEND_CLEAN(src, 0, 0, 0)
   
   class Array;
   
 /**   /** 
         Pooled string.          Pooled string.
   
Line 83  public: Line 87  public:
         /// piece is tainted or not. the language to use when detaint           /// piece is tainted or not. the language to use when detaint 
         enum Untaint_lang {          enum Untaint_lang {
                 UL_UNKNOWN=0, ///< zero value handy for hash lookup @see untaint_lang_name2enum                  UL_UNKNOWN=0, ///< zero value handy for hash lookup @see untaint_lang_name2enum
                 UL_NO, ///< clean                  UL_CLEAN, ///< clean
                 UL_YES,  ///< tainted, untaint language as assigned later                   UL_TAINTED,  ///< tainted, untaint language as assigned later 
                 // untaint languages. assigned by ^untaint[lang]{...}                  // untaint languages. assigned by ^untaint[lang]{...}
                 UL_PASS_APPENDED,                  UL_PASS_APPENDED,
                         /**<                          /**<
Line 119  public: Line 123  public:
         */          */
         String& real_append(STRING_APPEND_PARAMS);          String& real_append(STRING_APPEND_PARAMS);
         /// @return <0 ==0 or >0 depending on comparison result          /// @return <0 ==0 or >0 depending on comparison result
         int cmp (int& partial, const String& src, size_t this_offset=0) const;          int cmp (int& partial, const String& src, 
                   size_t this_offset=0, Untaint_lang lang=UL_UNKNOWN) const;
         bool operator < (const String& src) const {     int p; return cmp(p, src)<0; }          bool operator < (const String& src) const {     int p; return cmp(p, src)<0; }
         bool operator > (const String& src) const {     int p; return cmp(p, src)>0; }          bool operator > (const String& src) const {     int p; return cmp(p, src)>0; }
         bool operator <= (const String& src) const { int p; return cmp(p, src)<=0; }          bool operator <= (const String& src) const { int p; return cmp(p, src)<=0; }
Line 139  public: Line 144  public:
                         -  1: means @c this starts @c src                          -  1: means @c this starts @c src
                         -  2: means @src starts @this                          -  2: means @src starts @this
         */          */
         int cmp(int& partial, const char* src_ptr, size_t src_size=0) const;          int cmp(int& partial, const char* src_ptr, size_t src_size=0, 
                   size_t this_offset=0, Untaint_lang lang=UL_UNKNOWN) const;
         bool operator == (const char* src_ptr) const {           bool operator == (const char* src_ptr) const { 
                 size_t src_size=src_ptr?strlen(src_ptr):0;                  size_t src_size=src_ptr?strlen(src_ptr):0;
                 if(size() != src_size)                  if(size() != src_size)
Line 163  public: Line 169  public:
         String& piece(size_t start, size_t finish) const;          String& piece(size_t start, size_t finish) const;
   
         /// @return position of substr in string, -1 means "not found" [String version]          /// @return position of substr in string, -1 means "not found" [String version]
         int pos(const String& substr, size_t this_offset=0) const;          int pos(const String& substr, 
                   size_t this_offset=0, Untaint_lang lang=UL_UNKNOWN) const;
         /// @return position of substr in string, -1 means "not found" [const char* version]          /// @return position of substr in string, -1 means "not found" [const char* version]
         int String::pos(const char *substr, size_t result) const;          int pos(const char *substr, size_t substr_size, 
                   size_t this_offset=0, Untaint_lang lang=UL_UNKNOWN) const;
   
           void split(Array& result, 
                   size_t *pos_after_ref, 
                   const char *delim, size_t delim_size, 
                   Untaint_lang lang, int limit=-1) const;
           void split(Array& result, 
                   size_t *pos_after_ref, 
                   const String& delim, 
                   Untaint_lang lang, int limit=-1) const;
   
           Table& match(const String *aorigin,
                   const String& regexp, const String& options) const;
   
 #ifndef NO_STRING_ORIGIN  #ifndef NO_STRING_ORIGIN
         /// origin of string. calculated by first row          /// origin of string. calculated by first row
Line 217  private: Line 237  private:
                 return append_here == link_row;                  return append_here == link_row;
         }          }
         void expand();          void expand();
         void set_lang(Chunk::Row *row, Untaint_lang lang, bool forced, size_t size);  
         char *String::store_to(char *dest) const;          char *String::store_to(char *dest) const;
   
 private: //disabled  private: //disabled

Removed from v.1.60  
changed lines
  Added in v.1.63


E-mail: