mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 09:59:44 +00:00
28 lines
1.1 KiB
C++
28 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "Device.hpp"
|
|
|
|
namespace io {
|
|
/// @brief Device based on the standard filesystem
|
|
class StdfsDevice : public Device {
|
|
public:
|
|
StdfsDevice(std::filesystem::path root, bool createDirectory = true);
|
|
|
|
std::filesystem::path resolve(std::string_view path) override;
|
|
std::unique_ptr<std::ostream> write(std::string_view path) override;
|
|
std::unique_ptr<std::istream> read(std::string_view path) override;
|
|
size_t size(std::string_view path) override;
|
|
file_time_type lastWriteTime(std::string_view path) override;
|
|
bool exists(std::string_view path) override;
|
|
bool isdir(std::string_view path) override;
|
|
bool isfile(std::string_view path) override;
|
|
bool mkdir(std::string_view path) override;
|
|
bool mkdirs(std::string_view path) override;
|
|
bool remove(std::string_view path) override;
|
|
uint64_t removeAll(std::string_view path) override;
|
|
std::unique_ptr<PathsGenerator> list(std::string_view path) override;
|
|
private:
|
|
std::filesystem::path root;
|
|
std::filesystem::path absoluteRoot;
|
|
};
|
|
}
|