mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
LibArchive: Extract logic for calculating ZIP statistics
This commit is contained in:
parent
60e35f2a97
commit
8d53442187
Notes:
sideshowbarker
2024-07-17 05:00:08 +09:00
Author: https://github.com/AtkinsSJ
Commit: 8d53442187
Pull-request: https://github.com/SerenityOS/serenity/pull/20206
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/trflynn89
Reviewed-by: https://github.com/vkoskiv
5 changed files with 63 additions and 25 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <AK/Stream.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibArchive/Statistics.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -254,7 +255,8 @@ struct ZipMember {
|
|||
class Zip {
|
||||
public:
|
||||
static Optional<Zip> try_create(ReadonlyBytes buffer);
|
||||
ErrorOr<bool> for_each_member(Function<ErrorOr<IterationDecision>(ZipMember const&)>);
|
||||
ErrorOr<bool> for_each_member(Function<ErrorOr<IterationDecision>(ZipMember const&)>) const;
|
||||
ErrorOr<Statistics> calculate_statistics() const;
|
||||
|
||||
private:
|
||||
static bool find_end_of_central_directory_offset(ReadonlyBytes, size_t& offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue