Moving code out of vfs/ that doesn't need to be there.

Progress on #294.
This commit is contained in:
Ben Vanik
2015-06-27 17:01:25 -07:00
parent abf47b7973
commit 23f91b58f3
8 changed files with 113 additions and 142 deletions

View File

@@ -31,6 +31,14 @@ class DiscImageDevice : public Device {
std::unique_ptr<Entry> ResolvePath(const char* path) override;
uint32_t total_allocation_units() const override {
return uint32_t(mmap_->size() / sectors_per_allocation_unit() /
bytes_per_sector());
}
uint32_t available_allocation_units() const override { return 0; }
uint32_t sectors_per_allocation_unit() const override { return 1; }
uint32_t bytes_per_sector() const override { return 2 * 1024; }
private:
std::wstring local_path_;
std::unique_ptr<MappedMemory> mmap_;

View File

@@ -27,6 +27,11 @@ class HostPathDevice : public Device {
std::unique_ptr<Entry> ResolvePath(const char* path) override;
uint32_t total_allocation_units() const override { return 128 * 1024; }
uint32_t available_allocation_units() const override { return 128 * 1024; }
uint32_t sectors_per_allocation_unit() const override { return 1; }
uint32_t bytes_per_sector() const override { return 2 * 1024; }
private:
std::wstring local_path_;
bool read_only_;

View File

@@ -31,6 +31,14 @@ class STFSContainerDevice : public Device {
std::unique_ptr<Entry> ResolvePath(const char* path) override;
uint32_t total_allocation_units() const override {
return uint32_t(mmap_->size() / sectors_per_allocation_unit() /
bytes_per_sector());
}
uint32_t available_allocation_units() const override { return 0; }
uint32_t sectors_per_allocation_unit() const override { return 1; }
uint32_t bytes_per_sector() const override { return 4 * 1024; }
private:
std::wstring local_path_;
std::unique_ptr<MappedMemory> mmap_;