Add skeleton of oar library

This commit is contained in:
kayomn 2023-02-19 16:43:30 +00:00
parent 125dcc4cdf
commit 9af0e860cb
1 changed files with 44 additions and 0 deletions

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);