src/Generic/common/LocatedString.cpp
/** Create a substring.  (Private constructor)
 * 
 * @param s the source string.
 * @param begin_index the index of the first character to copy, inclusive.
 * @param end_index the index of the last character to copy, *exclusive*. 
 *                  Note that this contrasts with most other places in the
 *                  code, where end offsets and end positions are inclusive.
 *
 */
Create a substring.  (Private constructor)

@param s the source string.
@param begin_index the index of the first character to copy, inclusive.
@param end_index the index of the last character to copy, *exclusive*.
Note that this contrasts with most other places in the
code, where end offsets and end positions are inclusive.
Create a substring . ( Private constructor ) @param s the source string . @param begin_index the index of the first character to copy inclusive . @param end_index the index of the last character to copy * exclusive * . Note that this contrasts with most other places in the code where end offsets and end positions are inclusive .
LocatedString::LocatedString(const LocatedString &s, int begin_index, int end_index)
	: _text(s._text.begin()+begin_index, s._text.begin()+end_index)
{
	if (end_index < begin_index) {
		throw InternalInconsistencyException("LocatedString::LocatedString", 
			"Error constructing substring: end_offset is less than begin_offset");
	}
	s.copyOffsetsOfSubstring(begin_index, end_index, _offsets);
	initialize_bounds();
	assert(checkOffsetInvariants());
}
LocatedString :: LocatedString ( const LocatedString & s , int begin_index , int end_index ) : _text ( s . _text . begin ( ) + begin_index , s . _text . begin ( ) + end_index ) { if ( end_index < begin_index ) { throw InternalInconsistencyException ( " " , " " ) ; } s . copyOffsetsOfSubstring ( begin_index , end_index , _offsets ) ; initialize_bounds ( ) ; assert ( checkOffsetInvariants ( ) ) ; }
Create a substring.
Create a substring .
/*	if (end_index == begin_index) {
		throw InternalInconsistencyException("LocatedString::LocatedString", 
			"Error constructing substring: zero-length LocatedStrings are not allowed.");
	}*/ // Copy the offsets from s to _offsets.
 // Initialize the bounds from the substring.  We do *not* copy them from the
 // source string.
