|
|
| version 1.54, 2001/03/29 15:00:20 | version 1.60, 2001/04/02 09:29:17 |
|---|---|
| Line 82 public: | Line 82 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, ///< when get by name fails | UL_UNKNOWN=0, ///< zero value handy for hash lookup @see untaint_lang_name2enum |
| UL_NO, ///< clean | UL_NO, ///< clean |
| UL_YES, ///< tainted, untaint language as assigned later | UL_YES, ///< tainted, untaint language as assigned later |
| // untaint languages. assigned by ^untaint[lang]{...} | // untaint languages. assigned by ^untaint[lang]{...} |
| Line 119 public: | Line 119 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 (const String& src) const; | int cmp (int& partial, const String& src, size_t this_offset=0) const; |
| bool operator < (const String& src) const { return cmp(src)<0; } | bool operator < (const String& src) const { int p; return cmp(p, src)<0; } |
| bool operator > (const String& src) const { return cmp(src)>0; } | bool operator > (const String& src) const { int p; return cmp(p, src)>0; } |
| bool operator <= (const String& src) const { return cmp(src)<=0; } | bool operator <= (const String& src) const { int p; return cmp(p, src)<=0; } |
| bool operator >= (const String& src) const { return cmp(src)>=0; } | bool operator >= (const String& src) const { int p; return cmp(p, src)>=0; } |
| bool operator == (const String& src) const { | bool operator == (const String& src) const { |
| if(size()!=src.size()) // can speed up in trivial case | if(size()!=src.size()) // can speed up in trivial case |
| return false; | return false; |
| return cmp(src)==0; | int p; return cmp(p, src)==0; |
| } | } |
| bool operator != (const String& src) const { return cmp(src)!=0; } | bool operator != (const String& src) const { int p; return cmp(p, src)!=0; } |
| /** | /** |
| @param partial | @param partial |
| Line 139 public: | Line 139 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(const char* src_ptr, int& partial, size_t src_size=0) const; | int cmp(int& partial, const char* src_ptr, size_t src_size=0) 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) |
| return false; | return false; |
| int partial; // unused | int partial; // unused |
| return cmp(src_ptr, partial, src_size)==0; | return cmp(partial, src_ptr, src_size)==0; |
| } | } |
| /** | /** |
| Line 162 public: | Line 162 public: |
| /// extracts [start, finish) piece of string | /// extracts [start, finish) piece of string |
| 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] | |
| int pos(const String& substr, size_t this_offset=0) const; | |
| /// @return position of substr in string, -1 means "not found" [const char* version] | |
| int String::pos(const char *substr, size_t result) const; | |
| #ifndef NO_STRING_ORIGIN | #ifndef NO_STRING_ORIGIN |
| /// origin of string. calculated by first row | /// origin of string. calculated by first row |
| const Origin& origin() const; | const Origin& origin() const; |
| Line 171 private: | Line 176 private: |
| struct Chunk { | struct Chunk { |
| // the number of rows in chunk | // the number of rows in chunk |
| int count; | size_t count; |
| union Row { | union Row { |
| // fragment | // fragment |
| struct { | struct { |