-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.h
58 lines (50 loc) · 1.55 KB
/
functions.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
/**
* @file functions.h
* @brief Header file for auxiliary functions.
*/
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#include <string>
#include <vector>
#include "parameters.h"
#include "lz77.h"
/**
* @brief Function to check the correctness of compression/decompression parameters.
*/
bool validateParams(const CompressionParams ¶ms);
/**
* @brief Function to read the contents of a file into a vector.
*
* @param fileName File name.
* @return Vector containing the contents of the file.
*/
std::vector<char> readFileContent(const std::string &fileName);
/**
* @brief Function to write the contents of a vector to a file.
*
* @param compressedData Vector containing the contents of the file.
* @param outputFileName File name.
*/
void writeCompressedData(const std::vector<Token> &compressedData, const std::string &outputFileName);
/**
* @brief Function to perform compression.
*
* @param fileContent Vector containing the contents of the file.
* @param params Compression parameters.
*/
void performCompression(const std::vector<char> &fileContent, const CompressionParams ¶ms);
/**
* @brief Function to perform decompression.
*
* @param fileContent Vector containing the contents of the file.
* @param params Compression parameters.
*/
void performDecompression(const std::vector<char> &fileContent, const CompressionParams ¶ms);
/**
* @brief Coordinating function for compression/decompression.
*
* @param params Compression parameters.
* @return Program exit code.
*/
int solve(const CompressionParams ¶ms);
#endif // FUNCTIONS_H