-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.hpp
39 lines (32 loc) · 963 Bytes
/
data.hpp
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
#pragma once
#include <string>
#include <utility>
#include <vector>
#include <filesystem>
#include <cstdio>
struct SubRecord {
std::string name;
int size;
std::string data;
SubRecord(std::string name, int size, std::string data)
: name(std::move(name)), size(size), data(std::move(data)) {}
};
struct Record {
std::string name;
int size;
int header;
int flags;
std::vector<SubRecord> subrecords;
Record(std::string name, int size, int header, int flags,
std::vector<SubRecord> subrecords)
: name(std::move(name)), size(size), header(header), flags(flags), subrecords(std::move(subrecords)) {}
};
bool
human_unpack(Record &nowRecord,
SubRecord &nowSubRecord,
std::filesystem::path recordPath,
int k,
FILE *file,
FILE *output);
bool human_pack(std::vector<Record> &records,
std::filesystem::path flex);