mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +00:00
LibCore: Move Stream-based file into the Core
namespace
This commit is contained in:
parent
a96339b72b
commit
606a3982f3
218 changed files with 748 additions and 643 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <LibCore/DateTime.h>
|
||||
#include <LibCore/DeprecatedFile.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/Stream.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibCrypto/Checksum/CRC32.h>
|
||||
|
@ -50,12 +51,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
|
||||
outln("Archive: {}", zip_file_path);
|
||||
auto file_stream = TRY(Core::Stream::File::open(zip_file_path, Core::Stream::OpenMode::Write));
|
||||
auto file_stream = TRY(Core::File::open(zip_file_path, Core::File::OpenMode::Write));
|
||||
Archive::ZipOutputStream zip_stream(move(file_stream));
|
||||
|
||||
auto add_file = [&](DeprecatedString path) -> ErrorOr<void> {
|
||||
auto canonicalized_path = LexicalPath::canonicalized_path(path);
|
||||
auto file = TRY(Core::Stream::File::open(path, Core::Stream::OpenMode::Read));
|
||||
auto file = TRY(Core::File::open(path, Core::File::OpenMode::Read));
|
||||
auto file_buffer = TRY(file->read_until_eof());
|
||||
Archive::ZipMember member {};
|
||||
member.name = TRY(String::from_deprecated_string(canonicalized_path));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue