mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
65 lines
2.0 KiB
C++
65 lines
2.0 KiB
C++
#ifndef _VFS_UNCOMPRESSED_LIB_BASE_H_
|
|
#define _VFS_UNCOMPRESSED_LIB_BASE_H_
|
|
|
|
#include "../Interface/vfs_library_interface.h"
|
|
#include "../Interface/vfs_directory_interface.h"
|
|
#include <sstream>
|
|
|
|
namespace vfs
|
|
{
|
|
|
|
class VFS_API CUncompressedLibraryBase : public vfs::ILibrary
|
|
{
|
|
protected:
|
|
typedef std::map<vfs::Path, vfs::TDirectory<vfs::ILibrary::tWriteType>*, vfs::Path::Less> tDirCatalogue;
|
|
struct SFileData
|
|
{
|
|
SFileData(vfs::size_t const& fileSize, vfs::size_t const& fileOffset)
|
|
: _fileSize(fileSize), _fileOffset(fileOffset), _currentReadPosition(0)
|
|
{};
|
|
vfs::size_t _fileSize, _fileOffset, _currentReadPosition;
|
|
};
|
|
typedef std::map<tFileType*, SFileData> tFileData;
|
|
|
|
class IterImpl;
|
|
public:
|
|
CUncompressedLibraryBase(vfs::tReadableFile *libraryFile, vfs::Path const& mountPoint, bool ownFile = false);
|
|
virtual ~CUncompressedLibraryBase();
|
|
|
|
/**
|
|
* TVFSLocation interface
|
|
*/
|
|
virtual bool fileExists(vfs::Path const& filename);
|
|
virtual vfs::IBaseFile* getFile(vfs::Path const& filename);
|
|
virtual tFileType* getFileTyped(vfs::Path const& filename);
|
|
virtual void getSubDirList(std::list<vfs::Path>& rlSubDirs);
|
|
|
|
/**
|
|
* ILibrary interface
|
|
*/
|
|
virtual bool init() = 0;
|
|
virtual void closeLibrary();
|
|
|
|
virtual void close(tFileType *fileHandle);
|
|
virtual bool openRead(tFileType *fileHandle);
|
|
virtual vfs::size_t read(tFileType *fileHandle, vfs::Byte* data, vfs::size_t bytesToRead);
|
|
|
|
virtual vfs::size_t getReadPosition(tFileType *fileHandle);
|
|
virtual void setReadPosition(tFileType *fileHandle, vfs::size_t positionInBytes);
|
|
virtual void setReadPosition(tFileType *fileHandle, vfs::offset_t offsetInBytes, IBaseFile::ESeekDir seekDir);
|
|
|
|
virtual vfs::size_t getSize(tFileType *fileHandle);
|
|
|
|
virtual Iterator begin();
|
|
protected:
|
|
tDirCatalogue m_dirs;
|
|
tFileData m_fileData;
|
|
vfs::UInt32 m_numberOfOpenedFiles;
|
|
private:
|
|
SFileData& _fileDataFromHandle(tFileType* handle);
|
|
};
|
|
} // end namespace
|
|
|
|
#endif // _VFS_UNCOMPRESSED_LIB_BASE_H_
|
|
|