Changeset 9415 in orxonox.OLD for branches/terrain/src/lib/util/filesys/binary_file.h
- Timestamp:
- Jul 24, 2006, 12:59:44 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/util/filesys/binary_file.h
r9414 r9415 22 22 } 23 23 24 ~DataSemantics() 24 ~DataSemantics() 25 25 { 26 26 delete[] chunks; 27 27 } 28 28 29 29 int totalSize; 30 30 int quantifier; … … 33 33 union { 34 34 int type; 35 DataSemantics **chunks; 36 }; 35 DataSemantics **chunks; 36 }; 37 37 }; 38 38 … … 40 40 41 41 class BinaryFile : public File { 42 public: 42 public: 43 43 BinaryFile() 44 44 : File( "" ), 45 45 byteorder( NATIVE_BYTEORDER ) 46 46 { /* nothing to be done */ } 47 47 48 48 BinaryFile( const std::string& _file ) 49 : File( _file ), 49 : File( _file ), 50 50 byteorder( NATIVE_BYTEORDER ) 51 51 { /* nothing to be done */ } 52 52 53 53 BinaryFile( const BinaryFile& _file ) 54 : File( _file.name() ), 54 : File( _file.name() ), 55 55 byteorder( _file.getByteorder() ) 56 56 { /* nothing to be done */ } 57 57 58 58 /** 59 59 * Reads a chunk of data based on the _semantics string. The string contains … … 70 70 */ 71 71 void read( const char *_semantics, void* _buf, size_t& _bytesRead ); 72 72 73 73 /** 74 74 * The same as the read above, but with the ability to read multiple 75 * chunks once. Very useful if you don't know how many chunks you're 75 * chunks once. Very useful if you don't know how many chunks you're 76 76 * going to read at compile time. 77 77 */ 78 void read( const char *_semantics, int _chunks, 78 void read( const char *_semantics, int _chunks, 79 79 void* _buf, size_t& _bytesRead ); 80 80 /** … … 93 93 * in the middle of reading a file. You're totally on your own. 94 94 */ 95 inline void setByteorder( ByteOrder _order ) 95 inline void setByteorder( ByteOrder _order ) 96 96 { byteorder = _order; } 97 97 98 98 /** 99 99 * Returns the file's byte-order. … … 101 101 inline ByteOrder getByteorder() const 102 102 { return byteorder; } 103 103 104 104 private: 105 pDataSemantics compileSemantics( const char *_semantics ); 105 pDataSemantics compileSemantics( const char *_semantics ); 106 106 ByteOrder byteorder; 107 107 };
Note: See TracChangeset
for help on using the changeset viewer.