commit 1.2

This commit is contained in:
2026-09-09 00:52:00 -03:00
parent 572b5c7bd5
commit f30f25a91e
10 changed files with 436 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
export module io;
import std;
namespace brc {
export [[nodiscard]] std::string read_file(const std::filesystem::path& path);
export class mapped_file {
private:
int fd;
void* data = nullptr;
std::size_t length = 0;
public:
explicit mapped_file(const std::filesystem::path& path);
mapped_file(const mapped_file&) = delete;
mapped_file& operator=(const mapped_file&) = delete;
mapped_file(mapped_file&& rhs) noexcept;
mapped_file& operator=(mapped_file&& rhs) noexcept;
~mapped_file();
operator std::string_view() const noexcept;
[[nodiscard]] std::size_t size() const noexcept;
};
} // namespace brc