diff options
| author | bunnei <bunneidev@gmail.com> | 2014-07-04 21:58:08 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2014-07-04 21:58:08 -0400 |
| commit | ad1adb2f9270cc48bfbfd8b12ad1dac162c48e39 (patch) | |
| tree | 6bb6ab148504beaacdfa02ed1dd069e3a5f61427 /src/core/file_sys/meta_file_system.h | |
| parent | 469fe42fad01fc45e454e6acfa413eeae92e587e (diff) | |
| parent | b70c4fb48ec32057e56d9c0373794670bddd4f34 (diff) | |
Merge pull request #26 from bunnei/romfs-archive
Adds preliminary RomFS archive support
Diffstat (limited to 'src/core/file_sys/meta_file_system.h')
| -rw-r--r-- | src/core/file_sys/meta_file_system.h | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/src/core/file_sys/meta_file_system.h b/src/core/file_sys/meta_file_system.h deleted file mode 100644 index f358d8d5c..000000000 --- a/src/core/file_sys/meta_file_system.h +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) 2012- PPSSPP Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0 or later versions. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. - -#pragma once - -#include "common/std_mutex.h" - -#include "core/file_sys/file_sys.h" - -class MetaFileSystem : public IHandleAllocator, public IFileSystem -{ -private: - u32 current; - struct MountPoint - { - std::string prefix; - IFileSystem *system; - - bool operator == (const MountPoint &other) const - { - return prefix == other.prefix && system == other.system; - } - }; - std::vector<MountPoint> fileSystems; - - typedef std::map<int, std::string> currentDir_t; - currentDir_t currentDir; - - std::string startingDirectory; - int lastOpenError; - std::recursive_mutex lock; - -public: - MetaFileSystem() - { - current = 6; // what? - } - - void Mount(std::string prefix, IFileSystem *system); - void Unmount(std::string prefix, IFileSystem *system); - - void ThreadEnded(int threadID); - - void Shutdown(); - - u32 GetNewHandle() {return current++;} - void FreeHandle(u32 handle) {} - - virtual void DoState(PointerWrap &p); - - IFileSystem *GetHandleOwner(u32 handle); - 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); - - std::vector<FileInfo> GetDirListing(std::string path); - u32 OpenFile(std::string filename, FileAccess access, const char *devicename = NULL); - u32 OpenWithError(int &error, std::string filename, FileAccess access, const char *devicename = NULL); - void CloseFile(u32 handle); - size_t ReadFile(u32 handle, u8 *pointer, s64 size); - size_t WriteFile(u32 handle, const u8 *pointer, s64 size); - size_t SeekFile(u32 handle, s32 position, FileMove type); - FileInfo GetFileInfo(std::string filename); - bool OwnsHandle(u32 handle) {return false;} - inline size_t GetSeekPos(u32 handle) - { - return SeekFile(handle, 0, FILEMOVE_CURRENT); - } - - virtual int ChDir(const std::string &dir); - - virtual bool MkDir(const std::string &dirname); - virtual bool RmDir(const std::string &dirname); - virtual int RenameFile(const std::string &from, const std::string &to); - virtual bool RemoveFile(const std::string &filename); - - // TODO: void IoCtl(...) - - void SetStartingDirectory(const std::string &dir) { - std::lock_guard<std::recursive_mutex> guard(lock); - startingDirectory = dir; - } -}; |
