src/Generic/state/XMLSerializedDocTheory.cpp
//=============== Methods Used While (De)Serializing ==================

Methods Used While (De)Serializing
Methods Used While ( De ) Serializing
void XMLSerializedDocTheory::setOriginalText(const LocatedString* originalText) {
	if (originalText == 0)
		throw InternalInconsistencyException("XMLSerializedDocTheory::setOriginalText",
			"Attempt to set the original text to NULL");
	if (_originalText != 0) 
		throw InternalInconsistencyException("XMLSerializedDocTheory::setOriginalText",
			"Attempt to set the original text on an XMLSerializedDocTheory that already has an original text");
	_originalText = originalText;
	if (originalText->length() == 0) { return; } 
	CharOffset offset = originalText->start<CharOffset>();
	for (int pos=0; pos<originalText->length(); ++pos) {
		if ((originalText->start<CharOffset>(pos) != offset) ||
			(originalText->end<CharOffset>(pos) != offset))
			throw InternalInconsistencyException("XMLSerializedDocTheory::setOriginalText",
				"Char offsets not contiguous -- has this LocatedString been modified?");
		++offset;
	}
}
void XMLSerializedDocTheory :: setOriginalText ( const LocatedString * originalText ) { if ( originalText == 0 ) throw InternalInconsistencyException ( " " , " " ) ; if ( _originalText != 0 ) throw InternalInconsistencyException ( " " , " " ) ; _originalText = originalText ; if ( originalText -> length ( ) == 0 ) { return ; } CharOffset offset = originalText -> start < CharOffset > ( ) ; for ( int pos = 0 ; pos < originalText -> length ( ) ; ++ pos ) { if ( ( originalText -> start < CharOffset > ( pos ) != offset ) || ( originalText -> end < CharOffset > ( pos ) != offset ) ) throw InternalInconsistencyException ( " " , " " ) ; ++ offset ; } }
Methods Used While (De)Serializing
Methods Used While ( De ) Serializing
// Sanity check: make sure that character offsets and positions line up:
 // Sanity check makes no sense if we have the empty string.
