-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainutils.h
60 lines (54 loc) · 1.22 KB
/
mainutils.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
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
#include "stdafx.h"
#ifndef MAINUTILS_H
#define MAINUTILS_H
string inputFolder,outputFolder;
string grepStr="";
bool dayFiles = false;
bool cbufrProcess = false;
bool printUsageStrings(int argc, char* argv[])
{
if (argc <= 1)
{
std::cout << "usage: " << argv[0] << " /O=out_folder /I=in_folder /D" << std::endl;
return 0;
}
return 1;
}
void recognizeToken(string arg)
{
if (arg.find('O') != string::npos)
{
outputFolder = arg.substr(arg.find('O') + 2, arg.length() - 2);
cout<<"OutputFolder:"<<outputFolder<<endl;
}
if (arg.find('I') != string::npos)
{
inputFolder = arg.substr(arg.find('I') + 2, arg.length() - 2);
cout<<"InputFolder:"<<inputFolder<<endl;
}
if (arg.find('G') != string::npos)
{
grepStr = arg.substr(arg.find('G') + 2, arg.length() - 2);
cout<<"GREP str:"<<grepStr<<endl;
}
if (arg.find('D') != string::npos)
{
dayFiles = true;
}
if (arg.find('C') != string::npos)
{
cbufrProcess = true;
}
}
void processInputParameters(int argc, char* argv[])
{
std::istringstream oss;
stringstream ss;
int i;
inputFolder=".";
outputFolder="";
for (i = 1; i != argc; i++)
recognizeToken(string(argv[i]));
//printf("Point1\n");
}
#endif