Kelsidavis-WoWee/include/pipeline/loose_file_reader.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
937 B
C++

#pragma once
#include <string>
#include <vector>
#include <cstdint>
namespace wowee {
namespace pipeline {
/**
* LooseFileReader - Thread-safe filesystem file reader
*
* Each read opens its own file descriptor, so no mutex is needed.
* This replaces the serialized MPQ read path.
*/
class LooseFileReader {
public:
LooseFileReader() = default;
/**
* Read entire file into memory
* @param filesystemPath Full path to file on disk
* @return File contents (empty if not found or error)
*/
static std::vector<uint8_t> readFile(const std::string& filesystemPath);
/**
* Check if a file exists on disk
*/
static bool fileExists(const std::string& filesystemPath);
/**
* Get file size without reading
* @return Size in bytes, or 0 if not found
*/
static uint64_t getFileSize(const std::string& filesystemPath);
};
} // namespace pipeline
} // namespace wowee