/[svn]/libgig/trunk/src/RIFF.cpp
ViewVC logotype

Diff of /libgig/trunk/src/RIFF.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 808 by schoenebeck, Tue Nov 22 09:11:17 2005 UTC revision 833 by schoenebeck, Sun Feb 5 17:30:13 2006 UTC
# Line 1192  namespace RIFF { Line 1192  namespace RIFF {
1192          }          }
1193      }      }
1194    
1195        void List::LoadSubChunksRecursively() {
1196            for (List* pList = GetFirstSubList(); pList; pList = GetNextSubList())
1197                pList->LoadSubChunksRecursively();
1198        }
1199    
1200      /** @brief Write list chunk persistently e.g. to disk.      /** @brief Write list chunk persistently e.g. to disk.
1201       *       *
1202       * Stores the list chunk persistently to its actual "physical" file. All       * Stores the list chunk persistently to its actual "physical" file. All
# Line 1383  namespace RIFF { Line 1388  namespace RIFF {
1388       *                         chunk or any kind of IO error occured       *                         chunk or any kind of IO error occured
1389       */       */
1390      void File::Save() {      void File::Save() {
1391            // make sure the RIFF tree is built (from the original file)
1392            LoadSubChunksRecursively();
1393    
1394          // reopen file in write mode          // reopen file in write mode
1395          SetMode(stream_mode_read_write);          SetMode(stream_mode_read_write);
1396    
# Line 1460  namespace RIFF { Line 1468  namespace RIFF {
1468      void File::Save(const String& path) {      void File::Save(const String& path) {
1469          //TODO: we should make a check here if somebody tries to write to the same file and automatically call the other Save() method in that case          //TODO: we should make a check here if somebody tries to write to the same file and automatically call the other Save() method in that case
1470    
1471            // make sure the RIFF tree is built (from the original file)
1472            LoadSubChunksRecursively();
1473    
1474          if (Filename.length() > 0) SetMode(stream_mode_read);          if (Filename.length() > 0) SetMode(stream_mode_read);
1475          // open the other (new) file for writing and truncate it to zero size          // open the other (new) file for writing and truncate it to zero size
1476          #if POSIX          #if POSIX

Legend:
Removed from v.808  
changed lines
  Added in v.833

  ViewVC Help
Powered by ViewVC