31 lines
554 B
C++
31 lines
554 B
C++
|
#include <base/MmapFile.hpp>
|
||
|
|
||
|
#ifdef __linux__
|
||
|
#include "MmapFile.linux.cpp"
|
||
|
#else
|
||
|
#error Invalid platform
|
||
|
#endif
|
||
|
|
||
|
namespace lightningbolt {
|
||
|
|
||
|
MmapFile::MmapFile() : impl(std::make_unique<Impl>()) {
|
||
|
}
|
||
|
|
||
|
MmapFile::~MmapFile() = default;
|
||
|
|
||
|
ErrorOr<void> MmapFile::Open(const fs::path& path) {
|
||
|
return impl->Open(path);
|
||
|
}
|
||
|
|
||
|
void MmapFile::Close() {
|
||
|
return impl->Close();
|
||
|
}
|
||
|
|
||
|
u8* MmapFile::GetMapping() const {
|
||
|
return impl->GetMapping();
|
||
|
}
|
||
|
usize MmapFile::GetMappingSize() const {
|
||
|
return impl->GetMappingSize();
|
||
|
}
|
||
|
|
||
|
} // namespace lightningbolt
|