Skip to content

Commit

Permalink
Readd removed constructor of Archive.
Browse files Browse the repository at this point in the history
Pr #860 removed the constructor from (fd, offset, size).
This is a API break and we don't want that.
  • Loading branch information
mgautierfr committed Mar 8, 2024
1 parent 65bf7a8 commit c5c7a1e
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)

Check warning on line 48 in src/archive.cpp

View check run for this annotation

Codecov / codecov/patch

src/archive.cpp#L48

Added line #L48 was not covered by tests
: Archive(FdInput(fd, offset, size))
{}

Check warning on line 50 in src/archive.cpp

View check run for this annotation

Codecov / codecov/patch

src/archive.cpp#L50

Added line #L50 was not covered by tests

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

0 comments on commit c5c7a1e

Please sign in to comment.