2016-08-31 20:29:39 +01:00
|
|
|
#ifndef RWENGINE_FILEHANDLE_HPP
|
|
|
|
#define RWENGINE_FILEHANDLE_HPP
|
2015-02-26 03:57:28 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Contains a pointer to a file's contents.
|
|
|
|
*/
|
2016-09-09 21:13:21 +01:00
|
|
|
struct FileContentsInfo {
|
|
|
|
char* data;
|
|
|
|
size_t length;
|
2015-02-26 03:57:28 +00:00
|
|
|
|
2016-09-09 21:13:21 +01:00
|
|
|
FileContentsInfo(char* mem, size_t len) : data(mem), length(len) {
|
|
|
|
}
|
2016-08-31 20:36:29 +01:00
|
|
|
|
2016-09-09 21:13:21 +01:00
|
|
|
~FileContentsInfo() {
|
|
|
|
delete[] data;
|
|
|
|
}
|
2015-02-26 03:57:28 +00:00
|
|
|
};
|
|
|
|
|
2016-08-31 20:36:29 +01:00
|
|
|
using FileHandle = std::shared_ptr<FileContentsInfo>;
|
2016-08-31 20:29:39 +01:00
|
|
|
|
|
|
|
#endif
|