mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 02:19:44 +00:00
migrate from std::filesystem::path to io::path (WIP)
This commit is contained in:
parent
1e22882284
commit
e0314803c0
72 changed files with 1189 additions and 791 deletions
21
src/io/devices/StdfsDevice.hpp
Normal file
21
src/io/devices/StdfsDevice.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include "Device.hpp"
|
||||
|
||||
namespace io {
|
||||
class StdfsDevice : public Device {
|
||||
public:
|
||||
StdfsDevice(std::filesystem::path root) : root(std::move(root)) {}
|
||||
|
||||
std::filesystem::path resolve(std::string_view path) override;
|
||||
void write(std::string_view path, const void* data, size_t size) override;
|
||||
void read(std::string_view path, void* data, size_t size) override;
|
||||
size_t size(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;
|
||||
void mkdirs(std::string_view path) override;
|
||||
bool remove(std::string_view path) override;
|
||||
uint64_t removeAll(std::string_view path) override;
|
||||
private:
|
||||
std::filesystem::path root;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue