-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDummyRepairCompressor.h
55 lines (35 loc) · 1.05 KB
/
DummyRepairCompressor.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
//
// Created by alejandro on 30-07-19.
//
#ifndef RRPAIR_DUMMYREPAIRCOMPRESSOR_H
#define RRPAIR_DUMMYREPAIRCOMPRESSOR_H
#include <string>
#include <iostream>
#include <fstream>
class DummyRepairCompressor {
std::string cmd_repair_compressor;
uint max_mb_ram;
public:
DummyRepairCompressor(){}
DummyRepairCompressor(const std::string& c, const int& mb = -1){
cmd_repair_compressor = c;
max_mb_ram = mb;
}
~DummyRepairCompressor(){}
int compress(const std::string& file)
{
std::string command_compressing= "../"+cmd_repair_compressor + " "+ file ;
// std::cout<<command_compressing<<std::endl;
/* std::cout<<"FILE TO COMPRESS\n";
std::fstream rrf(file,std::ios::in);
while(!rrf.eof()){
int c = 0;
rrf.read((char*)&c,4);
std::cout<<c<<":"<<char(c)<<std::endl;
}
*/
if(system(command_compressing.c_str()) < 0) return -1;
return 1;
}
};
#endif //RRPAIR_DUMMYREPAIRCOMPRESSOR_H