mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
521 B
C++
24 lines
521 B
C++
3 years ago
|
#ifndef OPENMW_COMPONENTS_FILES_STREAMWITHBUFFER_H
|
||
|
#define OPENMW_COMPONENTS_FILES_STREAMWITHBUFFER_H
|
||
|
|
||
|
#include <istream>
|
||
|
#include <memory>
|
||
|
|
||
|
namespace Files
|
||
|
{
|
||
|
template <class Buffer>
|
||
|
class StreamWithBuffer final : public std::istream
|
||
|
{
|
||
|
public:
|
||
|
explicit StreamWithBuffer(std::unique_ptr<Buffer>&& buffer)
|
||
|
: std::istream(buffer.get())
|
||
|
, mBuffer(std::move(buffer))
|
||
|
{}
|
||
|
|
||
|
private:
|
||
|
std::unique_ptr<Buffer> mBuffer;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|