-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatchParser.h
More file actions
34 lines (26 loc) · 894 Bytes
/
PatchParser.h
File metadata and controls
34 lines (26 loc) · 894 Bytes
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
#ifndef PATCHPARSER_H_
#define PATCHPARSER_H_
#include <IGameConfigs.h>
#include <ITextParsers.h>
#include <string>
#include <vector>
#define MAX_PATCH_LENGTH 512
struct PatchEntry {
std::string m_name;
std::string m_description;
std::string m_signature;
char m_bytes[MAX_PATCH_LENGTH];
unsigned m_length;
};
typedef std::vector<PatchEntry> PatchEntryCollection;
class PatchParser : public SourceMod::ITextListener_SMC {
public:
SourceMod::SMCResult ReadSMC_NewSection(const SourceMod::SMCStates *states, const char *name);
SourceMod::SMCResult ReadSMC_KeyValue(const SourceMod::SMCStates *states, const char *key, const char *value);
SourceMod::SMCResult ReadSMC_LeavingSection(const SourceMod::SMCStates *states);
void AddPatches(SourceMod::IGameConfig *pCfg);
private:
PatchEntry m_currentPatch;
PatchEntryCollection m_patches;
};
#endif