-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFile.h
More file actions
38 lines (34 loc) · 1.1 KB
/
Copy pathFile.h
File metadata and controls
38 lines (34 loc) · 1.1 KB
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
#include <iostream>
#include <cstdio>
#include <cstring>
#include "DadosCompressorIF.h"
#define BUFFER_SIZE 10384 // 10000384
class File : public DadosCompressorIF {
public:
File(const char* filename);
unsigned long* getArrayFrequency();
unsigned int getCountByte(char byte);
void write(const unsigned char* ArrayDados, const unsigned int size);
void write(const unsigned int *ArrayDados, const unsigned int size);
void setTypeAction(const bool typeAction);
void operator = (DadosCompressorIF & copia);
unsigned char getPadding();
unsigned int read(unsigned char * buffer, const unsigned int size);
unsigned int read(unsigned int * buffer, const unsigned int size);
bool setOpenFile(bool for_read, bool append);
bool setCloseFile();
unsigned char* intToChar(unsigned int n);
unsigned int charToInt(unsigned char byte[4]);
char* getExt();
char* getFilename();
bool getFileIsOpen();
unsigned int getBufferSize();
~File();
private:
unsigned long* frequency = nullptr;
char* filename = nullptr;
char* ext = nullptr;
FILE* file_pointer = nullptr;
bool file_is_open = true;
bool append = false;
};