2012-06-01 15:23:19 +00:00
|
|
|
// VFSLoader.h - late loading of files not in the tree
|
|
|
|
// For conditions of distribution and use, see copyright notice in VFS.h
|
|
|
|
|
|
|
|
#ifndef VFSLOADER_H
|
|
|
|
#define VFSLOADER_H
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include "VFSDefines.h"
|
2014-04-06 17:19:33 +00:00
|
|
|
#include "VFSRefcounted.h"
|
2012-06-01 15:23:19 +00:00
|
|
|
|
|
|
|
VFS_NAMESPACE_START
|
|
|
|
|
2014-04-06 17:19:33 +00:00
|
|
|
class File;
|
|
|
|
class Dir;
|
2012-06-01 15:23:19 +00:00
|
|
|
|
|
|
|
// VFSLoader - to be called if a file is not in the tree.
|
2014-04-06 17:19:33 +00:00
|
|
|
class VFSLoader : public Refcounted
|
2012-06-01 15:23:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-04-06 17:19:33 +00:00
|
|
|
VFSLoader();
|
2012-06-01 15:23:19 +00:00
|
|
|
virtual ~VFSLoader() {}
|
2014-04-06 17:19:33 +00:00
|
|
|
virtual File *Load(const char *fn, const char *unmangled) = 0;
|
|
|
|
virtual Dir *LoadDir(const char *fn, const char *unmangled) { return NULL; }
|
|
|
|
|
|
|
|
inline Dir *getRoot() const { return root; }
|
|
|
|
protected:
|
|
|
|
Dir *root;
|
2012-06-01 15:23:19 +00:00
|
|
|
};
|
|
|
|
|
2014-04-06 17:19:33 +00:00
|
|
|
class DiskLoader : public VFSLoader
|
2012-06-01 15:23:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-04-06 17:19:33 +00:00
|
|
|
DiskLoader();
|
|
|
|
virtual ~DiskLoader() {}
|
|
|
|
virtual File *Load(const char *fn, const char *unmangled);
|
|
|
|
virtual Dir *LoadDir(const char *fn, const char *unmangled);
|
2012-06-01 15:23:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
VFS_NAMESPACE_END
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|