-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
43 lines (35 loc) · 717 Bytes
/
Copy pathMain.cpp
File metadata and controls
43 lines (35 loc) · 717 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
35
36
37
38
39
40
41
42
// Main.cpp : Defines the entry point for the console application.
//
#include "RleTests.h"
#include "RleData.h"
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include "RLEFile.h"
void Part1Tests()
{
TestFixtureFactory::theInstance().runTests();
}
int main(int argc, char* argv[])
{
if (argc < 2)
{
// Just the tests
Part1Tests();
}
else
{
std::string fileTest = argv[1];
RleFile test;
if(fileTest.substr(fileTest.length() - 3, fileTest.length()) == "rl1")
{
test.ExtractArchive(fileTest);
}
else
{
test.CreateArchive(fileTest);
}
}
return 0;
}