// **************************************************************************** // // Function Name: RStandaloneDocument::Read( ) // // Description: Reads from the specified storage // // Returns: Nothing // // Exceptions: File // // **************************************************************************** // void RStandaloneDocument::Read( RChunkStorage& storage, EReadReason reason ) { // Read version info if( !storage.Start( kVersionInfoTag, FALSE ).End( ) ) { YStreamLength yStartPos = storage.GetPosition( ); m_Version.Read( storage ); storage.SelectParentChunk( ); // set the version info of the file being read in // this should be cleared after the file is completely read (RApplication::GetApplicationGlobals())->SetCurrentDocumentVersion( m_Version ); // Start reading again where we left off before reading the version info storage.SeekAbsolute( yStartPos ); } // Reset the warned flag so that we will warn about any missing components. m_fWarnedAboutMissingComponent = FALSE; // Call the base method RDocument::Read( storage, reason ); // create a blank version info and set it in the global after the file is read RVersionInfo info; (RApplication::GetApplicationGlobals())->SetCurrentDocumentVersion(info); }
// **************************************************************************** // // Function Name: RBorderView::Read( ) // // Description: // // Returns: Override of RGraphicView::Read() because we need to update // the border's thickness after its bounding rect has been // read in from storage. // // Exceptions: None // // **************************************************************************** // void RBorderView::Read( RChunkStorage& storage ) { RGraphicView::Read( storage ); // Look for a wide border flag chunk RChunkStorage::RChunkSearcher rSearcher; rSearcher = storage.Start(kWideBorderFlagChunkId, !kRecursive); if (!rSearcher.End()) { storage >> m_fWideBorder; storage.SelectParentChunk(); }
// **************************************************************************** // // Function Name: RStandaloneDocument::Write( ) // // Description: Writes this documents data to the specified storage // // Returns: Nothing // // Exceptions: File // // **************************************************************************** // void RStandaloneDocument::Write( RChunkStorage& storage, EWriteReason reason ) const { // Write version info storage.AddChunk( kVersionInfoTag ); RVersionInfo version; version.GetVersionInfo( ); version.Write( storage ); storage.SelectParentChunk( ); // Call the base method RDocument::Write( storage, reason ); }