mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
update io::Device::read
This commit is contained in:
parent
dceb5f6ee4
commit
3e67d887f4
5 changed files with 72 additions and 29 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include <filesystem>
|
||||
|
||||
#include "../path.hpp"
|
||||
|
|
@ -13,7 +15,7 @@ namespace io {
|
|||
virtual std::filesystem::path resolve(std::string_view path) = 0;
|
||||
|
||||
virtual void write(std::string_view path, const void* data, size_t size) = 0;
|
||||
virtual void read(std::string_view path, void* data, size_t size) = 0;
|
||||
virtual std::unique_ptr<std::istream> read(std::string_view path) = 0;
|
||||
|
||||
virtual size_t size(std::string_view path) = 0;
|
||||
|
||||
|
|
@ -43,8 +45,8 @@ namespace io {
|
|||
parent->write((root / path).pathPart(), data, size);
|
||||
}
|
||||
|
||||
void read(std::string_view path, void* data, size_t size) override {
|
||||
parent->read((root / path).pathPart(), data, size);
|
||||
std::unique_ptr<std::istream> read(std::string_view path) override {
|
||||
return parent->read((root / path).pathPart());
|
||||
}
|
||||
|
||||
size_t size(std::string_view path) override {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue