mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
update io::Device::write
This commit is contained in:
parent
3e67d887f4
commit
1c98d6cb37
6 changed files with 50 additions and 12 deletions
|
|
@ -90,10 +90,11 @@ bool io::write_bytes(
|
|||
) {
|
||||
auto device = io::get_device(filename.entryPoint());
|
||||
if (device == nullptr) {
|
||||
return false;
|
||||
throw std::runtime_error("io-device not found: " + filename.entryPoint());
|
||||
}
|
||||
device->write(filename.pathPart(), data, size);
|
||||
return true;
|
||||
auto stream = device->write(filename.pathPart());
|
||||
stream->write(reinterpret_cast<const char*>(data), size);
|
||||
return stream->good();
|
||||
}
|
||||
|
||||
bool io::read(const io::path& filename, char* data, size_t size) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue