-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.h
More file actions
74 lines (60 loc) · 1.67 KB
/
Main.h
File metadata and controls
74 lines (60 loc) · 1.67 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* File: Main.h
* Author: hugh
*
* Created on July 26, 2016, 7:07 PM
*/
#ifndef MAIN_H
#define MAIN_H
#include <iostream>
#include <string>
#ifdef _WIN32
#include <windows.h>
#include <Shellapi.h>
#include <direct.h>
#endif
#ifndef _WIN32
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <ftw.h>
#endif
#include <cstdlib>
#include <fstream>
#include <streambuf>
#include <assert.h>
#include <exception>
#include <deque>
#include <algorithm>
#include <iterator>
#include "json/src/json.hpp"
#include "boost/algorithm/string.hpp"
#include "boost/algorithm/string/join.hpp"
using namespace std;
using json = nlohmann::json;
#ifndef STRRSPN
/*
A non-standard helper function:
Find c such that s=".*c[d]*", where [d]=delimiters and c in [d].
If c is not found, it returns the argument s.
*/
const char* strrspn( const char* s, const char* delimiters );
#endif
char* trim_left_advance( char* s, const char* delimiters );
class Main {
public:
Main();
void usage(char* prog);
void mainDriver(char* inputFilePath, char* delimiter, char* nodeKey);
static deque<string> split(string str, char delimiter);
static void display_deque(const deque<string> &v);
static const char internalDelimiterChar();
static const string internalDelimiterString();
static const string join(deque<string> strs, string delimiter);
static void writeStringToFile(string s, string filePath);
static const string getResultsDirectory();
static void deleteResultsDirectory();
static void createResultsDirectory();
};
#endif /* MAIN_H */