src/Generic/common/LocatedString.cpp
// Return true if this LocatedString is a proper substring of the given string.

Return true if this LocatedString is a proper substring of the given string.
Return true if this LocatedString is a proper substring of the given string .
bool LocatedString::isSubstringOf(const LocatedString *superstring) const {
	int superstring_start_pos = superstring->positionOfStartOffset(start<CharOffset>());
	if (superstring_start_pos < 0) 
		return false;
	if (superstring_start_pos+length() > superstring->length())
		return false;
	if (start<CharOffset>() != superstring->start<CharOffset>(superstring_start_pos))
		return false;
	if (end<CharOffset>() != superstring->end<CharOffset>(superstring_start_pos+length()-1))
		return false;
	if (superstring->_text.compare(superstring_start_pos, length(), _text)!=0)
		return false;
	return true;
}
bool LocatedString :: isSubstringOf ( const LocatedString * superstring ) const { int superstring_start_pos = superstring -> positionOfStartOffset ( start < CharOffset > ( ) ) ; if ( superstring_start_pos < 0 ) return false ; if ( superstring_start_pos + length ( ) > superstring -> length ( ) ) return false ; if ( start < CharOffset > ( ) != superstring -> start < CharOffset > ( superstring_start_pos ) ) return false ; if ( end < CharOffset > ( ) != superstring -> end < CharOffset > ( superstring_start_pos + length ( ) - 1 ) ) return false ; if ( superstring -> _text . compare ( superstring_start_pos , length ( ) , _text ) != 0 ) return false ; return true ; }
Return true if this LocatedString is a proper substring of the given string.
Return true if this LocatedString is a proper substring of the given string .