mirror of
https://github.com/tribes2/engine.git
synced 2026-03-24 22:59:13 +00:00
t2 engine svn checkout
This commit is contained in:
commit
ff569bd2ae
988 changed files with 394180 additions and 0 deletions
69
core/zipAggregate.h
Normal file
69
core/zipAggregate.h
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// V12 Engine
|
||||
//
|
||||
// Copyright (c) 2001 GarageGames.Com
|
||||
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _ZIPAGGREGATE_H_
|
||||
#define _ZIPAGGREGATE_H_
|
||||
|
||||
//Includes
|
||||
#ifndef _PLATFORM_H_
|
||||
#include "Platform/platform.h"
|
||||
#endif
|
||||
#ifndef _TVECTOR_H_
|
||||
#include "Core/tVector.h"
|
||||
#endif
|
||||
|
||||
class Stream;
|
||||
class ZipDirFileHeader;
|
||||
|
||||
class ZipAggregate
|
||||
{
|
||||
public:
|
||||
struct FileEntry {
|
||||
enum {
|
||||
Uncompressed = 0,
|
||||
Compressed = 1 << 0
|
||||
};
|
||||
|
||||
const char* pPath;
|
||||
const char* pFileName;
|
||||
U32 fileOffset;
|
||||
U32 fileSize;
|
||||
U32 compressedFileSize;
|
||||
U32 flags;
|
||||
};
|
||||
|
||||
//-------------------------------------- Instance scope members and decls.
|
||||
private:
|
||||
char* m_pZipFileName;
|
||||
Vector<FileEntry> m_fileList;
|
||||
|
||||
void enterZipDirRecord(const ZipDirFileHeader& in_rHeader);
|
||||
bool createZipDirectory(Stream*);
|
||||
void destroyZipDirectory();
|
||||
|
||||
ZipAggregate(const ZipAggregate&); // disallowed
|
||||
public:
|
||||
ZipAggregate();
|
||||
~ZipAggregate();
|
||||
|
||||
// Opening/Manipulation interface...
|
||||
public:
|
||||
bool openAggregate(const char* in_pFileName);
|
||||
void closeAggregate();
|
||||
bool refreshAggregate();
|
||||
|
||||
// Entry iteration interface...
|
||||
public:
|
||||
typedef Vector<FileEntry>::const_iterator iterator;
|
||||
|
||||
U32 numEntries() const { return m_fileList.size(); }
|
||||
const FileEntry& operator[](const U32 idx) const { return m_fileList[idx]; }
|
||||
iterator begin() const { return m_fileList.begin(); }
|
||||
iterator end() const { return m_fileList.end(); }
|
||||
};
|
||||
|
||||
#endif //_ZIPAGGREGATE_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue