/[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 1183 by persson, Sun May 13 10:34:29 2007 UTC revision 1207 by persson, Sat May 26 13:59:40 2007 UTC
# Line 1363  namespace RIFF { Line 1363  namespace RIFF {
1363       * Use this constructor if you want to create a new RIFF file completely       * Use this constructor if you want to create a new RIFF file completely
1364       * "from scratch". Note: there must be no empty chunks or empty list       * "from scratch". Note: there must be no empty chunks or empty list
1365       * chunks when trying to make the new RIFF file persistent with Save()!       * chunks when trying to make the new RIFF file persistent with Save()!
1366       * Note that this constructor will create a RIFX file on       *
1367       * big-endian machines.       * Note: by default, the RIFF file will be saved in native endian
1368         * format; that is, as a RIFF file on little-endian machines and
1369         * as a RIFX file on big-endian. To change this behaviour, call
1370         * SetByteOrder() before calling Save().
1371       *       *
1372       * @param FileType - four-byte identifier of the RIFF file type       * @param FileType - four-byte identifier of the RIFF file type
1373       * @see AddSubChunk(), AddSubList()       * @see AddSubChunk(), AddSubList(), SetByteOrder()
1374       */       */
1375      File::File(uint32_t FileType) : List(this) {      File::File(uint32_t FileType) : List(this) {
1376          #if defined(WIN32)          #if defined(WIN32)
# Line 1381  namespace RIFF { Line 1384  namespace RIFF {
1384          ListType = FileType;          ListType = FileType;
1385      }      }
1386    
   
     /** @brief Create new RIFF file.  
      *  
      * Use this constructor if you want to create a new RIFF file  
      * completely "from scratch" and also want to specify  
      * endianess. Note: there must be no empty chunks or empty list  
      * chunks when trying to make the new RIFF file persistent with  
      * Save()!  
      *  
      * @param FileType - four-byte identifier of the RIFF file type  
      * @param Endian - endianess used in the new file. A value of  
      *                 endian_little will create a RIFF file,  
      *                 endian_big a RIFX file, endian_native will  
      *                 create a RIFF file on little-endian machines  
      *                 and RIFX on big-endian.  
      * @see AddSubChunk(), AddSubList()  
      */  
     File::File(uint32_t FileType, endian_t Endian) : List(this) {  
         #if defined(WIN32)  
         hFileRead = hFileWrite = INVALID_HANDLE_VALUE;  
         #else  
         hFileRead = hFileWrite = 0;  
         #endif  
         Mode = stream_mode_closed;  
         #if WORDS_BIGENDIAN  
         bEndianNative = Endian != endian_little;  
         #else  
         bEndianNative = Endian != endian_big;  
         #endif  
         ulStartPos = RIFF_HEADER_SIZE;  
         ListType = FileType;  
     }  
   
1387      /** @brief Load existing RIFF file.      /** @brief Load existing RIFF file.
1388       *       *
1389       * Loads an existing RIFF file with all its chunks.       * Loads an existing RIFF file with all its chunks.
# Line 1562  namespace RIFF { Line 1532  namespace RIFF {
1532          return false;          return false;
1533      }      }
1534    
1535        /** @brief Set the byte order to be used when saving.
1536         *
1537         * Set the byte order to be used in the file. A value of
1538         * endian_little will create a RIFF file, endian_big a RIFX file
1539         * and endian_native will create a RIFF file on little-endian
1540         * machines and RIFX on big-endian machines.
1541         *
1542         * @param Endian - endianess to use when file is saved.
1543         */
1544        void File::SetByteOrder(endian_t Endian) {
1545            #if WORDS_BIGENDIAN
1546            bEndianNative = Endian != endian_little;
1547            #else
1548            bEndianNative = Endian != endian_big;
1549            #endif
1550        }
1551    
1552      /** @brief Save changes to same file.      /** @brief Save changes to same file.
1553       *       *
1554       * Make all changes of all chunks persistent by writing them to the       * Make all changes of all chunks persistent by writing them to the

Legend:
Removed from v.1183  
changed lines
  Added in v.1207

  ViewVC Help
Powered by ViewVC