Files
OpenVulkano/openVulkanoCpp/IO/Archive/ArchiveBase.cpp
2020-12-11 13:06:44 +01:00

30 lines
730 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 "ArchiveBase.hpp"
#include "LibArchiveHelper.hpp"
namespace openVulkanoCpp
{
ArchiveBase::ArchiveBase(archive* arch, archive_entry* archEntry, const std::shared_ptr<spdlog::logger>& logger)
: m_archive(arch), m_archiveEntry(archEntry), m_logger(logger)
{
if (!m_logger)
{
m_logger = Logger::FILESYS;
}
}
ArchiveBase::~ArchiveBase()
{
ChkErr(archive_free(m_archive));
}
bool ArchiveBase::ChkErr(int result) const
{
return LibArchiveHelper::CheckError(result, m_archive, m_logger);
}
}