2022-10-19 00:30:32 +02:00
|
|
|
#pragma once
|
|
|
|
#include <pugixml.hpp>
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
using file_contents_callback = std::function<void(const std::unique_ptr<std::uint8_t[]>& file_content, const int data_size)>;
|
2023-04-16 18:28:49 +00:00
|
|
|
|
2022-10-19 00:30:32 +02:00
|
|
|
class yim_fipackfile
|
|
|
|
{
|
|
|
|
rage::fiPackfile* rpf;
|
2023-04-19 16:57:49 +08:00
|
|
|
std::string mount_name;
|
2022-10-19 00:30:32 +02:00
|
|
|
|
|
|
|
public:
|
2023-04-19 16:57:49 +08:00
|
|
|
explicit yim_fipackfile(rage::fiPackfile* rpf, const std::string& mount_name = "/");
|
2023-04-02 00:37:26 +08:00
|
|
|
|
|
|
|
static inline std::vector<std::function<size_t(yim_fipackfile& rpf_wrapper)>> m_wrapper_call_back;
|
|
|
|
|
|
|
|
static void add_wrapper_call_back(std::function<size_t(yim_fipackfile& rpf_wrapper)> cb);
|
|
|
|
|
|
|
|
static void for_each_fipackfile();
|
|
|
|
|
2022-10-19 00:30:32 +02:00
|
|
|
std::vector<std::filesystem::path> get_file_paths(std::string parent = {});
|
|
|
|
|
2023-04-02 00:37:26 +08:00
|
|
|
const char* get_name();
|
|
|
|
|
2022-10-19 00:30:32 +02:00
|
|
|
void read_file(const std::filesystem::path& path, file_contents_callback&& cb);
|
|
|
|
|
|
|
|
void read_xml_file(const std::filesystem::path& path, std::function<void(pugi::xml_document& doc)> cb);
|
|
|
|
};
|
|
|
|
}
|