[ox/fs] Add base path access to PassthroughFS

This commit is contained in:
Gary Talent 2019-03-30 17:13:56 -05:00
parent 5dbe160633
commit 05c0eb2f78
4 changed files with 9 additions and 2 deletions

View File

@ -11,7 +11,7 @@
#include <ox/fs/filesystem/pathiterator.hpp>
#include <ox/fs/filestore/filestoretemplate.hpp>
#include <ox/ptrarith/nodebuffer.hpp>
#include <ox/std/std.hpp>
#include <ox/std/byteswap.hpp>
namespace ox {

View File

@ -21,6 +21,10 @@ PassThroughFS::PassThroughFS(const char *dirPath) {
PassThroughFS::~PassThroughFS() {
}
std::string PassThroughFS::basePath() {
return m_path.string();
}
Error PassThroughFS::mkdir(const char *path, bool recursive) {
bool success = false;
const auto p = m_path / stripSlash(path);

View File

@ -11,6 +11,7 @@
#if __has_include(<filesystem>)
#include <filesystem>
#include <string>
#include "filesystem.hpp"
@ -28,6 +29,8 @@ class PassThroughFS: public FileSystem {
~PassThroughFS();
[[nodiscard]] std::string basePath();
Error mkdir(const char *path, bool recursive = false) override;
Error move(const char *src, const char *dest) override;

View File

@ -8,7 +8,7 @@
#pragma once
#include <ox/std/std.hpp>
#include <ox/std/types.hpp>
namespace ox {