mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-11 08:15:51 +00:00
c4654fd8fa
debug: cleanup ogl_tex, tex: use full-width types to avoid truncation warnings wdbg_sym.cpp: skip __suppress and __profile symbols; add additional hex display for floats; cleanup wdll_ver.cpp: cppdoc+cleanup (remove non-reentrant C interface, replace with std::string) sysdep: add cppdoc everything else: flag parameters are now consistently size_t instead of int (avoids warnings, allows slightly better code on x64) This was SVN commit r6392.
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#ifndef INCLUDED_REAL_DIRECTORY
|
|
#define INCLUDED_REAL_DIRECTORY
|
|
|
|
#include "file_loader.h"
|
|
#include "lib/file/path.h"
|
|
|
|
class RealDirectory : public IFileLoader
|
|
{
|
|
public:
|
|
RealDirectory(const Path& path, size_t priority, size_t flags);
|
|
|
|
const Path& GetPath() const
|
|
{
|
|
return m_path;
|
|
}
|
|
|
|
size_t Priority() const
|
|
{
|
|
return m_priority;
|
|
}
|
|
|
|
size_t Flags() const
|
|
{
|
|
return m_flags;
|
|
}
|
|
|
|
// IFileLoader
|
|
virtual size_t Precedence() const;
|
|
virtual char LocationCode() const;
|
|
virtual LibError Load(const std::string& name, const shared_ptr<u8>& buf, size_t size) const;
|
|
|
|
LibError Store(const std::string& name, const shared_ptr<u8>& fileContents, size_t size);
|
|
|
|
void Watch();
|
|
|
|
private:
|
|
RealDirectory(const RealDirectory& rhs); // noncopyable due to const members
|
|
RealDirectory& operator=(const RealDirectory& rhs);
|
|
|
|
// note: paths are relative to the root directory, so storing the
|
|
// entire path instead of just the portion relative to the mount point
|
|
// is not all too wasteful.
|
|
const Path m_path;
|
|
|
|
const size_t m_priority;
|
|
|
|
const size_t m_flags;
|
|
|
|
// note: watches are needed in each directory because some APIs
|
|
// (e.g. FAM) cannot watch entire trees with one call.
|
|
void* m_watch;
|
|
};
|
|
|
|
typedef shared_ptr<RealDirectory> PRealDirectory;
|
|
|
|
extern PRealDirectory CreateRealSubdirectory(const PRealDirectory& realDirectory, const std::string& subdirectoryName);
|
|
|
|
#endif // #ifndef INCLUDED_REAL_DIRECTORY
|