Kelsidavis-WoWee/tools/asset_extract/manifest_writer.hpp
Kelsi aa16a687c2 Replace MPQ runtime with loose file asset system
Extract assets from MPQ archives into organized loose files indexed by
manifest.json, enabling fully parallel reads without StormLib serialization.
Add asset_extract and blp_convert tools, PNG texture override support.
2026-02-12 20:32:14 -08:00

40 lines
1.1 KiB
C++

#pragma once
#include <string>
#include <vector>
#include <cstdint>
namespace wowee {
namespace tools {
/**
* Generates manifest.json from extracted file metadata.
*/
class ManifestWriter {
public:
struct FileEntry {
std::string wowPath; // Normalized WoW virtual path (lowercase, backslash)
std::string filesystemPath; // Relative path from basePath (forward slashes, original case)
uint64_t size; // File size in bytes
uint32_t crc32; // CRC32 checksum
};
/**
* Write manifest.json
* @param outputPath Full path to manifest.json
* @param basePath Value for basePath field (e.g., "assets")
* @param entries All extracted file entries
* @return true on success
*/
static bool write(const std::string& outputPath,
const std::string& basePath,
const std::vector<FileEntry>& entries);
/**
* Compute CRC32 of file data
*/
static uint32_t computeCRC32(const uint8_t* data, size_t size);
};
} // namespace tools
} // namespace wowee