src/Generic/common/LocatedString.cpp
// dst is an output parameter.

dst is an output parameter.
dst is an output parameter .
void LocatedString::copyOffsetsOfSubstring(int begin_index, int end_index, std::vector<LocatedString::OffsetEntry> &dst) const {
	if (begin_index == end_index) return;
	for (size_t entry_num = findOffsetEntryBefore(begin_index); entry_num < _offsets.size(); ++entry_num) {
		dst.push_back(_offsets[entry_num]);
		OffsetEntry& entry = dst.back();
		assert(!(entry.startPos > end_index));
		if (entry.startPos < begin_index) {
			entry.startPos = begin_index;
			entry.startOffset = startOffsetGroup(begin_index);
		}
		if (entry.endPos > end_index) {
			entry.endPos = end_index;
			entry.endOffset = endOffsetGroup(end_index-1);
		}
		entry.startPos -= begin_index;
		entry.endPos -= begin_index;
		if (entry.endPos >= (end_index-begin_index))
			break;
	}
}
void LocatedString :: copyOffsetsOfSubstring ( int begin_index , int end_index , std :: vector < LocatedString :: OffsetEntry > & dst ) const { if ( begin_index == end_index ) return ; for ( size_t entry_num = findOffsetEntryBefore ( begin_index ) ; entry_num < _offsets . size ( ) ; ++ entry_num ) { dst . push_back ( _offsets [ entry_num ] ) ; OffsetEntry & entry = dst . back ( ) ; assert ( ! ( entry . startPos > end_index ) ) ; if ( entry . startPos < begin_index ) { entry . startPos = begin_index ; entry . startOffset = startOffsetGroup ( begin_index ) ; } if ( entry . endPos > end_index ) { entry . endPos = end_index ; entry . endOffset = endOffsetGroup ( end_index - 1 ) ; } entry . startPos -= begin_index ; entry . endPos -= begin_index ; if ( entry . endPos >= ( end_index - begin_index ) ) break ; } }
dst is an output parameter.
dst is an output parameter .
// The new string's positions start at begin_index.
 // Check if we're done.
