jes/src/core/File.h
2016-07-24 12:37:34 -04:00

23 lines
374 B
C++

#ifndef FILE_H
#define FILE_H
#include <stdint.h>
#include <stdlib.h>
class File
{
public:
File() : m_fd(-1) {}
~File() { close(); }
bool open(const char * filename, bool writing = false);
void close();
size_t get_size();
bool read(uint8_t * buf, size_t size);
bool write(const uint8_t * buf, size_t size);
protected:
int m_fd;
};
#endif