From 37304f3cc920804c97d52df929b9871c057c55e0 Mon Sep 17 00:00:00 2001 From: xunchang Date: Tue, 12 Mar 2019 12:40:14 -0700 Subject: Implement FilePackage class This is another implementation of the Package class. And we will later need it when reading the package from FUSE. Bug: 127071893 Test: unit tests pass, sideload a file package on sailfish Change-Id: I3de5d5ef60b29c8b73517d6de3498459d7d95975 --- package.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'package.h') diff --git a/package.h b/package.h index 5eef9c965..cd44d10be 100644 --- a/package.h +++ b/package.h @@ -32,6 +32,13 @@ // interface for both packages loaded in memory and packages read from fd. class Package : public VerifierInterface { public: + static std::unique_ptr CreateMemoryPackage( + const std::string& path, const std::function& set_progress); + static std::unique_ptr CreateMemoryPackage( + std::vector content, const std::function& set_progress); + static std::unique_ptr CreateFilePackage(const std::string& path, + const std::function& set_progress); + virtual ~Package() = default; // Opens the package as a zip file and returns the ZipArchiveHandle. @@ -40,12 +47,6 @@ class Package : public VerifierInterface { // Updates the progress in fraction during package verification. void SetProgress(float progress) override; - static std::unique_ptr CreateMemoryPackage( - const std::string& path, const std::function& set_progress); - - static std::unique_ptr CreateMemoryPackage( - std::vector content, const std::function& set_progress); - protected: // An optional function to update the progress. std::function set_progress_; -- cgit v1.2.3