add io::last_write_time & add io::write_zip

This commit is contained in:
MihailRis
2025-02-25 02:03:01 +03:00
parent edb581bee3
commit 57d05bde57
8 changed files with 197 additions and 19 deletions
+13
View File
@@ -107,6 +107,14 @@ bool io::read(const io::path& filename, char* data, size_t size) {
return stream->good();
}
std::unique_ptr<std::ostream> io::write(const io::path& file) {
auto device = io::get_device(file.entryPoint());
if (device == nullptr) {
throw std::runtime_error("io-device not found: " + file.entryPoint());
}
return device->write(file.pathPart());
}
std::unique_ptr<std::istream> io::read(const io::path& filename) {
auto device = io::get_device(filename.entryPoint());
if (device == nullptr) {
@@ -307,6 +315,11 @@ size_t io::file_size(const io::path& file) {
return device.size(file.pathPart());
}
io::file_time_type io::last_write_time(const io::path& file) {
auto& device = io::require_device(file.entryPoint());
return device.lastWriteTime(file.pathPart());
}
std::filesystem::path io::resolve(const io::path& file) {
auto device = io::get_device(file.entryPoint());
if (device == nullptr) {