C++20 Port #5
							
								
								
									
										44
									
								
								source/oar.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								source/oar.cpp
									
									
									
									
									
										Normal 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);
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user