Repository navigation
Expand file tree
/
Copy pathBanksModule.hpp
More file actions
43 lines (35 loc) · 1.68 KB
/
Copy pathBanksModule.hpp
File metadata and controls
43 lines (35 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include <optional>
#include <string>
#include <vector>
#include "ModuleDispatcher.hpp"
#include "BNK.hpp"
#include "BanksDto.hpp"
#include "BatchInputObject.hpp"
class BanksModule {
public:
// Command strings (match the C# module)
static constexpr const char* CommandBankInfo = "BANK-I";
static constexpr const char* CommandBankUnpack = "BANK-U";
static constexpr const char* CommandBankBatchUnpack = "BANK-UX";
static constexpr const char* CommandBankRepack = "BANK-R";
static constexpr const char* CommandBankBatchRepack = "BANK-RX";
explicit BanksModule(ModuleDispatcher& moduleDispatcher);
// Commands
void Info(const std::vector<std::string>& args);
void Unpack(const std::vector<std::string>& args);
void BatchUnpack(const std::vector<std::string>& args);
void Repack(const std::vector<std::string>& args);
void BatchRepack(const std::vector<std::string>& args);
// Param helpers
static std::string GetBankFileNameParam(const std::vector<std::string>& args);
static std::string GetPackedFileParam(const std::vector<std::string>& args);
static std::string GetBatchInputFileParam(const std::vector<std::string>& args);
// Optional 3rd param (target directory for unpack, or source file for repack where applicable)
static std::optional<std::string> GetThirdParam(const std::vector<std::string>& args);
private:
ModuleDispatcher& dispatcher_;
static std::unique_ptr<BNK> LoadBankFileOrThrow(const std::string& bankFileName);
static BatchInputObject LoadBatchInputFileOrThrow(const std::string& batchInputFileName);
static BankInfoOutputObject BuildBankInfo(const BNK& bankFile);
};