From fe0cfc52bccfe9b07b71c950910ac04a559af4fe Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 20 Oct 2016 22:25:39 +0200 Subject: [PATCH] Q3BSP-Loader: reformat include. --- code/Q3BSPZipArchive.h | 116 +++++++++++++++++-------------------------------- 1 file changed, 41 insertions(+), 75 deletions(-) diff --git a/code/Q3BSPZipArchive.h b/code/Q3BSPZipArchive.h index 12ec154..4dcd7a8 100644 --- a/code/Q3BSPZipArchive.h +++ b/code/Q3BSPZipArchive.h @@ -58,24 +58,15 @@ namespace Q3BSP { /// \brief // ------------------------------------------------------------------------------------------------ class IOSystem2Unzip { - - public: - - static voidpf open(voidpf opaque, const char* filename, int mode); - - static uLong read(voidpf opaque, voidpf stream, void* buf, uLong size); - - static uLong write(voidpf opaque, voidpf stream, const void* buf, uLong size); - - static long tell(voidpf opaque, voidpf stream); - - static long seek(voidpf opaque, voidpf stream, uLong offset, int origin); - - static int close(voidpf opaque, voidpf stream); - - static int testerror(voidpf opaque, voidpf stream); - - static zlib_filefunc_def get(IOSystem* pIOHandler); +public: + static voidpf open(voidpf opaque, const char* filename, int mode); + static uLong read(voidpf opaque, voidpf stream, void* buf, uLong size); + static uLong write(voidpf opaque, voidpf stream, const void* buf, uLong size); + static long tell(voidpf opaque, voidpf stream); + static long seek(voidpf opaque, voidpf stream, uLong offset, int origin); + static int close(voidpf opaque, voidpf stream); + static int testerror(voidpf opaque, voidpf stream); + static zlib_filefunc_def get(IOSystem* pIOHandler); }; // ------------------------------------------------------------------------------------------------ @@ -85,32 +76,21 @@ class IOSystem2Unzip { /// \brief // ------------------------------------------------------------------------------------------------ class ZipFile : public IOStream { - friend class Q3BSPZipArchive; - public: - - explicit ZipFile(size_t size); - - ~ZipFile(); - - size_t Read(void* pvBuffer, size_t pSize, size_t pCount ); - - size_t Write(const void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/); - - size_t FileSize() const; - - aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/); - - size_t Tell() const; - - void Flush(); - - private: - - void* m_Buffer; - - size_t m_Size; +public: + explicit ZipFile(size_t size); + ~ZipFile(); + size_t Read(void* pvBuffer, size_t pSize, size_t pCount ); + size_t Write(const void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/); + size_t FileSize() const; + aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/); + size_t Tell() const; + void Flush(); + +private: + void* m_Buffer; + size_t m_Size; }; // ------------------------------------------------------------------------------------------------ @@ -121,39 +101,25 @@ class ZipFile : public IOStream { /// from a P3K archive ( Quake level format ). // ------------------------------------------------------------------------------------------------ class Q3BSPZipArchive : public Assimp::IOSystem { - - public: - - static const unsigned int FileNameSize = 256; - - public: - - Q3BSPZipArchive(IOSystem* pIOHandler, const std::string & rFile); - - ~Q3BSPZipArchive(); - - bool Exists(const char* pFile) const; - - char getOsSeparator() const; - - IOStream* Open(const char* pFile, const char* pMode = "rb"); - - void Close(IOStream* pFile); - - bool isOpen() const; - - void getFileList(std::vector &rFileList); - - private: - - bool mapArchive(); - - private: - - unzFile m_ZipFileHandle; - - std::map m_ArchiveMap; - +public: + static const unsigned int FileNameSize = 256; + +public: + Q3BSPZipArchive(IOSystem* pIOHandler, const std::string & rFile); + ~Q3BSPZipArchive(); + bool Exists(const char* pFile) const; + char getOsSeparator() const; + IOStream* Open(const char* pFile, const char* pMode = "rb"); + void Close(IOStream* pFile); + bool isOpen() const; + void getFileList(std::vector &rFileList); + +private: + bool mapArchive(); + +private: + unzFile m_ZipFileHandle; + std::map m_ArchiveMap; }; // ------------------------------------------------------------------------------------------------ -- 2.7.4