diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-12-14 01:20:38 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-12-14 15:20:37 +0000 |
commit | 1ec646ab940e3f0f5e4dfdb18762ba46c9735c91 (patch) | |
tree | 5bb89d877957069eef1c73637c38b11af099b369 /Userland/Utilities/tar.cpp | |
parent | 9ec2cb3741cbe617edb0451360720bfacdfdb119 (diff) | |
download | serenity-1ec646ab940e3f0f5e4dfdb18762ba46c9735c91.zip |
LibArchive: Port `TarOutputStream` to `Core::Stream`
Diffstat (limited to 'Userland/Utilities/tar.cpp')
-rw-r--r-- | Userland/Utilities/tar.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Userland/Utilities/tar.cpp b/Userland/Utilities/tar.cpp index 6e0aebdf83..f1527670d5 100644 --- a/Userland/Utilities/tar.cpp +++ b/Userland/Utilities/tar.cpp @@ -215,12 +215,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) if (!directory.is_empty()) TRY(Core::System::chdir(directory)); - Core::OutputFileStream file_stream(file); - Compress::GzipCompressor gzip_stream(file_stream); + NonnullOwnPtr<OutputStream> file_output_stream = make<Core::OutputFileStream>(file); + NonnullOwnPtr<OutputStream> gzip_output_stream = make<Compress::GzipCompressor>(*file_output_stream); - OutputStream& file_output_stream = file_stream; - OutputStream& gzip_output_stream = gzip_stream; - Archive::TarOutputStream tar_stream((gzip) ? gzip_output_stream : file_output_stream); + Archive::TarOutputStream tar_stream(make<Core::Stream::WrappedAKOutputStream>(move((gzip) ? gzip_output_stream : file_output_stream))); auto add_file = [&](DeprecatedString path) -> ErrorOr<void> { auto file = Core::File::construct(path); |