Refactoring vfs to remove a lot of duplicated code.

Progress on #294.
This commit is contained in:
Ben Vanik
2015-06-27 22:37:49 -07:00
parent 1ac19f1b08
commit 83872d8e8f
37 changed files with 877 additions and 1366 deletions

View File

@@ -13,6 +13,7 @@
#include <memory>
#include <string>
#include "xenia/base/string_buffer.h"
#include "xenia/vfs/entry.h"
namespace xe {
@@ -23,11 +24,14 @@ class Device {
Device(const std::string& path);
virtual ~Device();
virtual bool Initialize() = 0;
void Dump(StringBuffer* string_buffer);
const std::string& mount_path() const { return mount_path_; }
virtual bool is_read_only() const { return true; }
virtual std::unique_ptr<Entry> ResolvePath(const char* path) = 0;
Entry* ResolvePath(const char* path);
virtual uint32_t total_allocation_units() const = 0;
virtual uint32_t available_allocation_units() const = 0;
@@ -36,6 +40,7 @@ class Device {
protected:
std::string mount_path_;
std::unique_ptr<Entry> root_entry_;
};
} // namespace vfs