2015-02-17 11:26:28 +00:00
|
|
|
#ifndef OPENMW_CONSTRAINEDFILESTREAM_H
|
|
|
|
#define OPENMW_CONSTRAINEDFILESTREAM_H
|
|
|
|
|
2022-04-14 15:01:36 +00:00
|
|
|
#include "constrainedfilestreambuf.hpp"
|
2022-04-14 23:55:14 +00:00
|
|
|
#include "streamwithbuffer.hpp"
|
2022-04-14 15:01:36 +00:00
|
|
|
|
2015-02-17 11:26:28 +00:00
|
|
|
#include <istream>
|
2017-05-05 19:21:11 +00:00
|
|
|
#include <memory>
|
2022-04-10 15:25:26 +00:00
|
|
|
#include <limits>
|
|
|
|
#include <string>
|
2015-02-17 15:19:21 +00:00
|
|
|
|
2015-02-17 11:26:28 +00:00
|
|
|
namespace Files
|
|
|
|
{
|
|
|
|
|
|
|
|
/// A file stream constrained to a specific region in the file, specified by the 'start' and 'length' parameters.
|
2022-04-14 23:55:14 +00:00
|
|
|
using ConstrainedFileStream = StreamWithBuffer<ConstrainedFileStreamBuf>;
|
2015-02-17 11:26:28 +00:00
|
|
|
|
2022-04-15 00:15:39 +00:00
|
|
|
typedef std::unique_ptr<std::istream> IStreamPtr;
|
2015-02-17 15:19:21 +00:00
|
|
|
|
2022-04-10 15:25:26 +00:00
|
|
|
IStreamPtr openConstrainedFileStream(const std::string& filename, std::size_t start = 0,
|
|
|
|
std::size_t length = std::numeric_limits<std::size_t>::max());
|
2015-02-17 15:19:21 +00:00
|
|
|
|
2015-02-17 11:26:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|