X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fpacksource.h;fp=source%2Fpacksource.h;h=440b45118bd66fc2af1c1d0c7b2f0a195a237fd9;hp=a599b5c0c99c985eaa8b834721f5158b8356b52d;hb=461967af6834fb0fccdd39a8d76192d411223148;hpb=0bf1684c1ae0f5ecc23b7c64f0a0fec79a8c2082 diff --git a/source/packsource.h b/source/packsource.h index a599b5c..440b451 100644 --- a/source/packsource.h +++ b/source/packsource.h @@ -48,13 +48,15 @@ private: private: std::string filename; + IO::Seekable *io; unsigned base_offset; std::list files; public: - Pack(const std::string &); + Pack(IO::Seekable *, const std::string &); const std::string &get_filename() const { return filename; } + IO::Seekable *get_io() const { return io; } unsigned get_base_offset() const { return base_offset; } void collect_files(FileMap &, const std::string &) const; @@ -123,6 +125,15 @@ public: read on the first call; subsequent calls will use cached data. */ void add_pack_file(const std::string &, const std::string &); + /** Adds a pack from an existing seekable I/O object. The same object is + used for all accesses to the pack, so it must not be deleted before the + PackSource. */ + void add_pack_io(IO::Seekable &, const std::string & = std::string()); + +private: + void add_pack(IO::Seekable *, const std::string &, const std::string &); + +public: /// Returns information about the files in the pack. std::list list_files() const;