forked from Soreepeong/XivAlexander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommandLine.h
32 lines (24 loc) · 1.3 KB
/
CommandLine.h
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
#pragma once
#include <vector>
#include <string>
#include "XivAlexanderCommon/Sqex.h"
namespace Sqex::CommandLine {
extern const char ChecksumTable[17];
extern const char ObfuscationHead[13];
extern const char ObfuscationTail[5];
namespace WellKnown {
namespace Keys {
static constexpr const char* Language = "language";
static constexpr const char* Region = "SYS.Region";
}
void SetRegion(std::vector<std::pair<std::string, std::string>>& args, Region region);
Region GetRegion(const std::vector<std::pair<std::string, std::string>>& args, Region fallback = Region::Unspecified);
void SetLanguage(std::vector<std::pair<std::string, std::string>>& args, Language language);
Language GetLanguage(const std::vector<std::pair<std::string, std::string>>& args, Language fallback = Language::Unspecified);
};
std::vector<std::pair<std::string, std::string>> FromString(const std::wstring& source, bool* wasObfuscated = nullptr);
std::wstring ToString(const std::vector<std::pair<std::string, std::string>>& args, bool obfuscate);
void ModifyParameter(std::vector<std::pair<std::string, std::string>>& args, const std::string& key, std::string value);
void ReverseEvery4Bytes(std::string& s);
std::vector<std::string> SplitPreserveDelimiter(const std::string& source, char delimiter, size_t maxCount);
}