Files
OpenVulkano/openVulkanoCpp/IO/MemMappedFile.cpp
mtuncbilek 95ddd4b23f memmappedfile-fix (#115)
Co-authored-by: Metehan Tuncbilek <mtuncbilek95@gmail.com>
Reviewed-by: Georg Hagen <georg.hagen@madvoxel.com>
Co-authored-by: mtuncbilek <metehan.tuncbilek@madvoxel.com>
Co-committed-by: mtuncbilek <metehan.tuncbilek@madvoxel.com>
2024-09-21 14:46:39 +02:00

22 lines
647 B
C++

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "MemMappedFile.hpp"
#include "Base/Logger.hpp"
#include "MemMappedFileInternal.hpp"
namespace OpenVulkano
{
MemMappedFile::MemMappedFile(const std::filesystem::path& path, FileMode fileMode)
: m_data(nullptr), m_size(0)
{
std::string file = path.string();
m_internal = std::make_shared<MemMappedFileInternal>(file.c_str(), fileMode);
m_data = m_internal->address;
m_size = (m_data) ? m_internal->size : 0;
}
}