-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
35 lines (31 loc) · 980 Bytes
/
utils.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
33
34
35
#pragma once
#include <tuple>
#include <fstream>
#include <memory>
#include "defs.h"
#include "Buffer.h"
#include <argparse/argparse.hpp>
#include "TournamentTree.h"
using std::string;
using std::tuple;
using std::vector;
using argparse::ArgumentParser;
struct Config {
RowCount recordCount;
RowSize recordSize;
string tracePath;
string outputPath;
string inputPath;
bool removeDuplicates;
string removalMethod;
};
Config getArgs(int argc, char* argv[]);
tuple<string, string> separatePath(string path);
string byteToHexString(byte byte);
string rowToHexString(byte * rowContent, RowSize size);
u_int32_t getRecordCountPerRun(RowSize recordSize);
string rowToString(byte * rowContent, RowSize size);
string rowRawValueToString(byte * rowContent, RowSize size);
tuple<vector<u_int8_t>, vector<u_int64_t>> parseDeviceType(const string &filename);
u_int8_t getLargestDeviceType(const string &filename);
void renameOutputFile(const string &outputPath);