File: constrainedfilestream.hpp

package info (click to toggle)
openmw 0.49.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,992 kB
  • sloc: cpp: 372,479; xml: 2,149; sh: 1,403; python: 797; makefile: 26
file content (22 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef OPENMW_CONSTRAINEDFILESTREAM_H
#define OPENMW_CONSTRAINEDFILESTREAM_H

#include "constrainedfilestreambuf.hpp"
#include "istreamptr.hpp"
#include "streamwithbuffer.hpp"

#include <limits>
#include <string>

namespace Files
{

    /// A file stream constrained to a specific region in the file, specified by the 'start' and 'length' parameters.
    using ConstrainedFileStream = StreamWithBuffer<ConstrainedFileStreamBuf>;

    IStreamPtr openConstrainedFileStream(const std::filesystem::path& filename, std::size_t start = 0,
        std::size_t length = std::numeric_limits<std::size_t>::max());

}

#endif