1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 12:03:51 +00:00
Aquaria/ExternalLibs/ttvfs/VFSLoader.h

43 lines
915 B
C
Raw Normal View History

// 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"
VFS_NAMESPACE_START
2014-04-06 17:19:33 +00:00
class File;
class Dir;
// VFSLoader - to be called if a file is not in the tree.
2014-04-06 17:19:33 +00:00
class VFSLoader : public Refcounted
{
public:
2014-04-06 17:19:33 +00:00
VFSLoader();
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;
};
2014-04-06 17:19:33 +00:00
class DiskLoader : public VFSLoader
{
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);
};
VFS_NAMESPACE_END
#endif