[GME-commit] GMESRC/GME/XmlBackEnd CoreXmlFile.cpp,1.35,1.36

Log messages of CVS commits gme-commit at list.isis.vanderbilt.edu
Fri May 9 08:59:13 CDT 2008


Update of /project/gme-repository/GMESRC/GME/XmlBackEnd
In directory escher:/tmp/cvs-serv29764

Modified Files:
	CoreXmlFile.cpp 
Log Message:
Undo scenarios produced files with only an xml header, because the Transcoder was initialized,
opened (that dumped the xml header) and only after that was examined whether the object
was deleted and thus dumped or not.

Now will trunc the file (open with 'w' and close) in case it is in deleted state.
Will open the transcoder only if was not a deleted.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: CoreXmlFile.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/CoreXmlFile.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** CoreXmlFile.cpp	7 May 2008 20:51:45 -0000	1.35
--- CoreXmlFile.cpp	9 May 2008 13:59:11 -0000	1.36
***************
*** 3406,3412 ****
  	try
  	{
- 		ofs.init( fileName.c_str(), "UTF-8"); // create a transcoder fstream
- 		// Transcoder dumps by default the xml version and encoding
- 
  		bool deleted = false;
  		// Is this object deleted according to its current state?
--- 3406,3409 ----
***************
*** 3425,3434 ****
  		if( !deleted)
  		{
  			// write objects recursively
  			writeObject( container, ofs, true, "", currentTime2 );
  		}
  		// deleted containers will have a file of 0 size
! 
! 		ofs.finalize();
  
  		// now it's time to get file's exact 'Modified At' attribute
--- 3422,3439 ----
  		if( !deleted)
  		{
+ 			ofs.init( fileName.c_str(), "UTF-8"); // create a transcoder fstream
+ 			// Transcoder dumps by default the xml version and encoding
+ 
  			// write objects recursively
  			writeObject( container, ofs, true, "", currentTime2 );
+ 			ofs.finalize();
  		}
  		// deleted containers will have a file of 0 size
! 		if( deleted) // really overwrite the file
! 		{
! 			std::ofstream zero; 
! 			zero.open( fileName.c_str(), std::ios_base::out | std::ios_base::trunc); // 'w'
! 			zero.close();
! 		}
  
  		// now it's time to get file's exact 'Modified At' attribute



More information about the GME-commit mailing list