--- parser3/src/include/pa_string.h 2001/03/29 17:11:40 1.57 +++ parser3/src/include/pa_string.h 2001/04/02 15:59:35 1.61 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.h,v 1.57 2001/03/29 17:11:40 paf Exp $ + $Id: pa_string.h,v 1.61 2001/04/02 15:59:35 paf Exp $ */ #ifndef PA_STRING_H @@ -82,7 +82,7 @@ public: /// piece is tainted or not. the language to use when detaint 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_YES, ///< tainted, untaint language as assigned later // untaint languages. assigned by ^untaint[lang]{...} @@ -139,7 +139,8 @@ public: - 1: means @c this starts @c src - 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) const; bool operator == (const char* src_ptr) const { size_t src_size=src_ptr?strlen(src_ptr):0; if(size() != src_size) @@ -162,8 +163,10 @@ public: /// extracts [start, finish) piece of string String& piece(size_t start, size_t finish) const; - /// @return position of substr in string, -1 means "not found" - int pos(const String& substr) 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 pos(const char *substr, size_t result) const; #ifndef NO_STRING_ORIGIN /// origin of string. calculated by first row