C++20 Port #5

Merged
kayomn merged 35 commits from cpp-port into main 2023-02-20 02:33:45 +01:00
1 changed files with 44 additions and 0 deletions
Showing only changes of commit 9af0e860cb - Show all commits

44
source/oar.cpp Normal file
View File

@ -0,0 +1,44 @@
export module oar;
import core;
import core.files;
export namespace oar {
constexpr core::usize signature_length{4};
constexpr core::u8 signature_magic[signature_length]{'o', 'a', 'r', 0};
struct entry {
core::u8 signature_magic[signature_length];
core::path path;
core::u64 data_offset;
core::u64 data_length;
core::u8 padding[244];
};
struct archive : public core::fs {
using core::fs::access_result;
archive() {
}
access_result read_file(core::path const & file_path,
core::callable<void(core::readable const &)> const & then) override {
return access_result::access_denied;
}
virtual access_result write_file(core::path const & file_path,
core::callable<void(core::writable const &)> const & then) override {
return access_result::access_denied;
}
};
}
static_assert(sizeof(oar::entry) == 512);