mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-02 00:42:33 +01:00
4fd92a1549
Also move up source files into the root directory, as there's nothing else in this directory
30 lines
665 B
C++
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
|