2022-04-15 01:55:14 +02:00
|
|
|
#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
|
|
|
|
{
|
2022-09-22 21:26:05 +03:00
|
|
|
public:
|
|
|
|
explicit StreamWithBuffer(std::unique_ptr<Buffer>&& buffer)
|
|
|
|
: std::istream(buffer.get())
|
|
|
|
, mBuffer(std::move(buffer))
|
|
|
|
{
|
|
|
|
}
|
2022-04-15 01:55:14 +02:00
|
|
|
|
2022-09-22 21:26:05 +03:00
|
|
|
private:
|
|
|
|
std::unique_ptr<Buffer> mBuffer;
|
2022-04-15 01:55:14 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|