mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-) - Multiplayer Version 1.1 + some additional features and bugfixes * INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory * git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
#ifndef _VFS_LIBRARY_INTERFACE_H_
|
|
#define _VFS_LIBRARY_INTERFACE_H_
|
|
|
|
#include "vfs_location_interface.h"
|
|
|
|
|
|
namespace vfs
|
|
{
|
|
|
|
class ILibrary : public vfs::IVFSLocation<vfs::IReadable,vfs::IWriteType>
|
|
{
|
|
public:
|
|
ILibrary(tReadableFile *pLibraryFile, vfs::Path const& sMountPoint, bool bOwnFile = false)
|
|
: vfs::IVFSLocation<vfs::IReadable,vfs::IWriteType>(sMountPoint), m_pLibraryFile(pLibraryFile), m_bOwnLibFile(bOwnFile)
|
|
{};
|
|
virtual ~ILibrary()
|
|
{
|
|
if(m_pLibraryFile && m_bOwnLibFile)
|
|
{
|
|
m_pLibraryFile->Close();
|
|
delete m_pLibraryFile;
|
|
m_pLibraryFile = NULL;
|
|
}
|
|
};
|
|
|
|
virtual bool Init() = 0;
|
|
virtual bool CloseLibrary() = 0;
|
|
|
|
virtual bool Close(tFileType *pFileHandle) = 0;
|
|
virtual bool OpenRead(tFileType *pFileHandle) = 0;
|
|
virtual bool Read(tFileType *pFileHandle, Byte* pData, UInt32 uiBytesToRead, UInt32& uiBytesRead) = 0;
|
|
|
|
virtual UInt32 GetReadLocation(tFileType *pFileHandle) = 0;
|
|
virtual bool SetReadLocation(tFileType *pFileHandle, UInt32 uiPositionInBytes) = 0;
|
|
virtual bool SetReadLocation(tFileType *pFileHandle, Int32 uiOffsetInBytes, IBaseFile::ESeekDir eSeekDir) = 0;
|
|
|
|
virtual bool GetFileSize(tFileType *pFileHandle, UInt32& uiFileSize) = 0;
|
|
|
|
vfs::Path const& GetLibName()
|
|
{
|
|
return m_pLibraryFile->GetFileName();
|
|
}
|
|
protected:
|
|
vfs::tReadableFile* m_pLibraryFile;
|
|
bool m_bOwnLibFile;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // _VFS_LIBRARY_INTERFACE_H_
|