34 lines
508 B
C++
34 lines
508 B
C++
#ifndef FILEREADER_HPP
|
|
#define FILEREADER_HPP
|
|
|
|
#include <stdio.h>
|
|
|
|
class FileReader{
|
|
|
|
private:
|
|
|
|
FILE* fd;
|
|
unsigned int length;
|
|
|
|
public:
|
|
|
|
FileReader(const char* path);
|
|
|
|
void readFully(char* buffer, unsigned int length);
|
|
|
|
unsigned int read(char* buffer, unsigned int count);
|
|
|
|
unsigned int isEOF();
|
|
|
|
void reset();
|
|
|
|
void seekTo(unsigned int index);
|
|
|
|
unsigned int getFileLength();
|
|
|
|
~FileReader();
|
|
|
|
};
|
|
|
|
#endif // FILEREADER_H
|