29 lines
461 B
C++
29 lines
461 B
C++
#ifndef FILE_H
|
|
#define FILE_H
|
|
|
|
#include "filesystem/filecommon.h"
|
|
|
|
class File
|
|
{
|
|
public:
|
|
File(const char* path, FileAccess access);
|
|
~File();
|
|
|
|
FILE* GetHandle() { return m_filehandle; }
|
|
|
|
void Seek(SeekDir seekdir, long offset);
|
|
size_t Tell();
|
|
bool Eof();
|
|
|
|
size_t Read(void* buffer, size_t size);
|
|
size_t Write(void const* buffer, size_t size);
|
|
|
|
// helpers
|
|
void ReadStringBuffer(char* buffer, size_t bufferSize);
|
|
|
|
private:
|
|
FILE* m_filehandle;
|
|
};
|
|
|
|
#endif
|