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

View file

@ -8,7 +8,6 @@
#include "../path.hpp"
namespace io {
/// @brief Device interface for file system operations
class Device {
public:
@ -28,6 +27,9 @@ namespace io {
/// @brief Get file size in bytes
virtual size_t size(std::string_view path) = 0;
/// @brief Get file last write timestamp
virtual file_time_type lastWriteTime(std::string_view path) = 0;
/// @brief Check if file or directory exists
virtual bool exists(std::string_view path) = 0;
@ -82,6 +84,10 @@ namespace io {
return parent->size((root / path).pathPart());
}
file_time_type lastWriteTime(std::string_view path) override {
return parent->lastWriteTime((root / path).pathPart());
}
bool exists(std::string_view path) override {
return parent->exists((root / path).pathPart());
}