rename System -> MountPoint and add convenience wrapper

This commit is contained in:
KentuckyCompass committed 2013-01-11 10:10:37 -08:00
1 parent 9f4680a267
commit a13c2da407
2 files changed
+36 -24

No files matched your search

+15 -3
View File
@@ -23,12 +23,12 @@ class MetaFileSystem : public IHandleAllocator, public IFileSystem
{
private:
u32 current;
struct System
struct MountPoint
{
std::string prefix;
IFileSystem *system;
};
std::vector<System> fileSystems;
std::vector<MountPoint> fileSystems;
typedef std::map<int, std::string> currentDir_t;
currentDir_t currentDir;
@@ -54,7 +54,19 @@ public:
virtual void DoState(PointerWrap &p);
IFileSystem *GetHandleOwner(u32 handle);
bool MapFilePath(const std::string &inpath, std::string &outpath, System **system);
bool MapFilePath(const std::string &inpath, std::string &outpath, MountPoint **system);
inline bool MapFilePath(const std::string &_inpath, std::string &outpath, IFileSystem **system)
{
MountPoint *mountPoint;
if (MapFilePath(_inpath, outpath, &mountPoint))
{
*system = mountPoint->system;
return true;
}
return false;
}
// Only possible if a file system is a DirectoryFileSystem or similar.
bool GetHostPath(const std::string &inpath, std::string &outpath);