1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 10:22:52 +01:00
openrw/rwcore/platform/FileHandle.hpp
Daniel Evans 4fd92a1549 Rename rwlib library to "core" to fit its new role
Also move up source files into the root directory, as there's nothing else in this directory
2018-08-09 20:28:24 +01:00

30 lines
665 B
C++

#ifndef _LIBRW_FILEHANDLE_HPP_
#define _LIBRW_FILEHANDLE_HPP_
#include <cstddef>
#include <memory>
/**
* @brief Contains a pointer to a file's contents.
*/
struct FileContentsInfo {
std::unique_ptr<char[]> data;
size_t length;
FileContentsInfo(std::unique_ptr<char[]> mem, size_t len)
: data(std::move(mem)), length(len) {
}
FileContentsInfo(FileContentsInfo&& info)
: data(std::move(info.data)), length(info.length) {
info.data = nullptr;
}
FileContentsInfo(FileContentsInfo& info) = delete;
FileContentsInfo& operator=(FileContentsInfo& info) = delete;
~FileContentsInfo() = default;
};
#endif