mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +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
94 lines
1.9 KiB
C++
94 lines
1.9 KiB
C++
#include "vfs_file_interface.h"
|
|
#include "vfs_library_interface.h"
|
|
|
|
/**********************************************************************
|
|
* vfs::FileAttributes
|
|
*/
|
|
vfs::FileAttributes::FileAttributes()
|
|
: _attribs(ATTRIB_NORMAL), _location(LT_NONE)
|
|
{
|
|
};
|
|
|
|
vfs::FileAttributes::FileAttributes(vfs::UInt32 attribs, LocationType location)
|
|
: _attribs(attribs), _location(location)
|
|
{
|
|
};
|
|
|
|
vfs::UInt32 vfs::FileAttributes::getAttrib() const
|
|
{
|
|
return _attribs;
|
|
};
|
|
|
|
vfs::UInt32 vfs::FileAttributes::getLocation() const
|
|
{
|
|
return _location;
|
|
};
|
|
|
|
bool vfs::FileAttributes::isAttribSet(vfs::UInt32 attribs) const
|
|
{
|
|
return attribs == (attribs & _attribs);
|
|
};
|
|
|
|
bool vfs::FileAttributes::isAttribNotSet(vfs::UInt32 attribs) const
|
|
{
|
|
return 0 == (attribs & _attribs);
|
|
};
|
|
|
|
bool vfs::FileAttributes::isLocation(vfs::UInt32 location) const
|
|
{
|
|
return location == (location & _location);
|
|
};
|
|
|
|
/**********************************************************************
|
|
* vfs::IBaseFile
|
|
*/
|
|
|
|
vfs::IBaseFile::IBaseFile(vfs::Path const& filename)
|
|
: m_filename(filename)
|
|
{};
|
|
|
|
vfs::IBaseFile::~IBaseFile()
|
|
{};
|
|
|
|
vfs::Path const& vfs::IBaseFile::getName()
|
|
{
|
|
return m_filename;
|
|
};
|
|
|
|
vfs::Path vfs::IBaseFile::getPath()
|
|
{
|
|
return this->getName();
|
|
};
|
|
|
|
|
|
bool vfs::IBaseFile::_getRealPath(vfs::Path& path)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**********************************************************************
|
|
* vfs::ILibrary
|
|
*/
|
|
|
|
vfs::ILibrary::ILibrary(vfs::tReadableFile *libraryFile, vfs::Path const& mountPoint, bool ownFile)
|
|
: tBaseClass(mountPoint), m_ownLibFile(ownFile), m_libraryFile(libraryFile)
|
|
{
|
|
}
|
|
|
|
vfs::ILibrary::~ILibrary()
|
|
{
|
|
if(m_libraryFile && m_ownLibFile)
|
|
{
|
|
m_libraryFile->close();
|
|
delete m_libraryFile;
|
|
m_libraryFile = NULL;
|
|
}
|
|
}
|
|
|
|
vfs::Path const& vfs::ILibrary::getName()
|
|
{
|
|
return m_libraryFile->getName();
|
|
}
|
|
|
|
/**********************************************************************/
|