LibArchive: Implement ZipOutputStream for zip archive creation

This output stream can be used to create zip archives, and will
be used in the implementation of the zip utility.
This commit is contained in:
Idan Horowitz 2021-03-22 21:53:12 +02:00 committed by Andreas Kling
commit 550ae23e80
Notes: sideshowbarker 2024-07-18 21:07:42 +09:00
2 changed files with 89 additions and 0 deletions

View file

@ -31,6 +31,7 @@
#include <AK/Span.h>
#include <AK/Stream.h>
#include <AK/String.h>
#include <AK/Vector.h>
#include <string.h>
namespace Archive {
@ -231,4 +232,17 @@ private:
ReadonlyBytes m_input_data;
};
class ZipOutputStream {
public:
ZipOutputStream(OutputStream&);
void add_member(const ZipMember&);
void finish();
private:
OutputStream& m_stream;
Vector<ZipMember> m_members;
bool m_finished { false };
};
}