ArchiveFile.h
Go to the documentation of this file.00001 00010 #ifndef __ArchiveFile_H__ 00011 #define __ArchiveFile_H__ 00012 00013 // Includes 00014 00015 // Forward declares 00016 class StaticBuffer; 00017 class Platform_FileSystem_File; 00018 00019 // ArchiveFile 00020 class ArchiveFile 00021 { 00022 public: 00023 ArchiveFile(Platform_FileSystem_File* file, int offset, int size, bool sharedFile); 00024 ArchiveFile(const StaticBuffer* memoryBuffer, int offset, int size); 00025 ArchiveFile(const ArchiveFile* archiveFile); 00026 ~ArchiveFile(); 00027 00028 // SeekOrigin 00029 enum SeekOrigin 00030 { 00031 SEEK_FROM_START = 0, 00032 SEEK_FROM_CURRENT = 1, 00033 SEEK_FROM_END = 2, 00034 }; 00035 00036 bool Open() const; 00037 bool Close() const; 00038 int GetSize() const; 00039 int Seek(int offset, SeekOrigin origin = SEEK_FROM_START) const; 00040 int Tell() const; 00041 00042 int Read(char* value, int count = 1) const; 00043 int Read(short* value, int count = 1) const; 00044 int Read(int* value, int count = 1) const; 00045 int Read(long* value, int count = 1) const; 00046 int Read(unsigned char* value, int count = 1) const; 00047 int Read(unsigned short* value, int count = 1) const; 00048 int Read(unsigned int* value, int count = 1) const; 00049 int Read(unsigned long* value, int count = 1) const; 00050 int Read(float* value, int count = 1) const; 00051 int Read(double* value, int count = 1) const; 00052 int Read(bool* value, int count = 1) const; 00053 00054 private: 00055 Platform_FileSystem_File* file_; 00056 bool sharedFile_; 00057 const StaticBuffer* buffer_; 00058 mutable int position_; 00059 int offset_; 00060 int size_; 00061 }; 00062 00063 00064 #endif /* __ArchiveFile_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
