Files
OpenVulkano/openVulkanoCpp/IO/Archive/ZipWriter.hpp
Vladyslav Baranovskyi 34bfebbdd3 Summary:
- Changes in Cat functions
- Using gmtime_s and gmtime_r as a thread-safe functions
- ZFill() that is used for padding
- Option for ZipWriter to pad LocalFileHeaders(it is used to properly run tests)
- ZipWriter::IsOpen()
- Moved material creation away from WriteObjContents
- Using MemMappedFile instead of ReadFile
- Scoping files and adding them to archive
- UsdEncoder refactoring
2024-11-27 20:21:14 +02:00

32 lines
782 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/.
*/
#pragma once
#include "IO/FileDescription.hpp"
#include <string>
#include <vector>
#include <filesystem>
namespace OpenVulkano
{
class ZipWriter
{
std::vector<uint8_t> m_centralDirs;
int m_numFiles = 0;
bool m_pad = false;
FILE* m_file;
public:
ZipWriter(const std::filesystem::path& filePath, bool alignHeadersby64 = false);
~ZipWriter();
bool IsOpen() const { return m_file != nullptr; }
void AddFile(const FileDescription& description, const void* buffer);
void AddFile(const std::filesystem::path& fileName, const char* inArchiveName);
};
}