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-07-16 16:19:56 +00:00
|
|
|
#include "istreamptr.hpp"
|
2022-04-14 23:55:14 +00:00
|
|
|
#include "streamwithbuffer.hpp"
|
2022-04-14 15:01:36 +00:00
|
|
|
|
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-06-19 11:28:33 +00:00
|
|
|
IStreamPtr openConstrainedFileStream(const std::filesystem::path& filename, std::size_t start = 0,
|
2022-04-10 15:25:26 +00:00
|
|
|
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
|