mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 01:17:46 +00:00
LibArchive: Add helper functions for adding members to a ZipOutputStream
This commit is contained in:
parent
2f85faef0f
commit
b5124bd826
3 changed files with 71 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <AK/Stream.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <string.h>
|
||||
|
||||
namespace Archive {
|
||||
|
@ -271,9 +272,20 @@ private:
|
|||
|
||||
class ZipOutputStream {
|
||||
public:
|
||||
struct MemberInformation {
|
||||
float compression_ratio;
|
||||
size_t compressed_size;
|
||||
};
|
||||
|
||||
ZipOutputStream(NonnullOwnPtr<Stream>);
|
||||
|
||||
ErrorOr<void> add_member(ZipMember const&);
|
||||
ErrorOr<MemberInformation> add_member_from_stream(StringView, Stream&, Optional<Core::DateTime> const& = {});
|
||||
|
||||
// NOTE: This does not add any of the files within the directory,
|
||||
// it just adds an entry for it.
|
||||
ErrorOr<void> add_directory(StringView, Optional<Core::DateTime> const& = {});
|
||||
|
||||
ErrorOr<void> finish();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue