-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
31 lines (27 loc) · 984 Bytes
/
main.cpp
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
#include "manager.hpp"
#include "utils.hpp"
#include "cmd_parser.hpp"
using namespace tatlin_tape;
int main (int argc, const char *argv[])
{
arguments_t parsed_args = parse_cmd_args(argc, argv);
if (!parsed_args.parsed)
return 0;
try {
tape_cnfg_t tape_conf = read_config(parsed_args.conf_path);
manager_t<int> manager {parsed_args.input_file_path,
parsed_args.output_file_path,
tape_conf, parsed_args.clear};
manager.copy_sort_tape();
} catch (std::bad_alloc &ba) {
std::cerr << "Can not allocate needed memory.\n";
return -1;
} catch (std::runtime_error &re) {
std::cerr << re.what();
return -2;
} catch (...) {
std::cerr << "Unknown error.\n";
return -3;
}
return 0;
}