// Copyright 2023 The LightningBolt Authors // SPDX-License-Identifier: MIT #pragma once #include #include namespace lightningbolt { /// A read-only file opened via memory mapping. /// On POSIX systems, we use mmap(2). Etc etc. struct MmapFile { MmapFile(); ~MmapFile(); // Opens for read-only mode. ErrorOr Open(const fs::path& path); void Close(); u8* GetMapping() const; usize GetMappingSize() const; private: struct Impl; Unique impl; }; }