26 #ifndef INNOEXTRACT_STREAM_SLICE_HPP 27 #define INNOEXTRACT_STREAM_SLICE_HPP 32 #include <boost/iostreams/concepts.hpp> 33 #include <boost/filesystem/path.hpp> 42 explicit slice_error(
const std::string & msg) : std::ios_base::failure(msg) { }
59 typedef boost::filesystem::path path_type;
62 const boost::uint32_t data_offset;
66 std::string base_file;
67 std::string base_file2;
68 const size_t slices_per_disk;
72 boost::uint32_t slice_size;
78 void seek(
size_t slice);
79 bool open_file(
const path_type &
file);
80 bool open_file_case_insensitive(
const path_type & dirname,
const path_type & filename);
81 void open(
size_t slice);
86 size_t slices_per_disk = 1);
100 slice_reader(std::istream * istream, boost::uint32_t offset);
117 slice_reader(
const path_type & dirname,
const std::string & basename,
const std::string & basename2,
118 size_t disk_slice_count);
129 bool seek(
size_t slice, boost::uint32_t offset);
146 std::streamsize
read(
char * buffer, std::streamsize bytes);
149 size_t slice() {
return current_slice; }
152 bool is_open() {
return (is != &ifs || ifs.is_open()); }
158 #endif // INNOEXTRACT_STREAM_SLICE_HPP boost::filesystem::{i,o,}fstream doesn't support unicode names on windows Implement our own wrapper u...
Abstraction for reading either data embedded inside the setup executable or from multiple external sl...
static std::string slice_filename(const std::string &basename, size_t slice, size_t slices_per_disk=1)
boost::filesystem::ifstream ifstream
slice_error(const std::string &msg)
std::streamsize read(char *buffer, std::streamsize bytes)
Read a number of bytes starting at the current slice and offset within that slice.
slice_reader(std::istream *istream, boost::uint32_t offset)
Construct a slice_reader to read from data inside the setup file.
Error thrown by slice_reader if there was a problem.
Information specifying a single file inside a compressed chunk.