Skip to content

Commit

Permalink
Merge pull request #864 from openzim/no_api_break
Browse files Browse the repository at this point in the history
Readd removed constructor of Archive.
  • Loading branch information
kelson42 authored Mar 9, 2024
2 parents 65bf7a8 + c5c7a1e commit f624344
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/zim/archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ namespace zim
*/
explicit Archive(int fd);

/** Archive constructor.
*
* Construct an archive from a descriptor of a file with an embedded ZIM
* archive inside.
* Fd is used only at Archive creation.
* Ownership of the fd is not taken and it must be closed by caller.
*
* Note: This function is not available under Windows.
*
* @param fd The descriptor of a seekable file with a continuous segment
* representing a complete ZIM archive.
* @param offset The offset of the ZIM archive relative to the beginning
* of the file (rather than the current position associated with fd).
* @param size The size of the ZIM archive.
*/
Archive(int fd, offset_type offset, size_type size);

/** Archive constructor.
*
* Construct an archive from a descriptor of a file with an embedded ZIM
Expand Down
4 changes: 4 additions & 0 deletions src/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ namespace zim
: m_impl(new FileImpl(fd))
{ }

Archive::Archive(int fd, offset_type offset, size_type size)
: Archive(FdInput(fd, offset, size))
{}

Archive::Archive(const std::vector<FdInput>& fds)
: m_impl(new FileImpl(fds))
{ }
Expand Down

0 comments on commit f624344

Please sign in to comment.