cleanup: let the handler own the file system implementation
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ic7c31237bd5440b2cfa171df93545a63708e404c
diff --git a/cleanup/cleanup.hpp b/cleanup/cleanup.hpp
index 2266668..6ee8405 100644
--- a/cleanup/cleanup.hpp
+++ b/cleanup/cleanup.hpp
@@ -16,13 +16,14 @@
public:
static std::unique_ptr<blobs::GenericBlobInterface>
CreateCleanupHandler(const std::string& blobId,
- const std::vector<std::string>& files);
+ const std::vector<std::string>& files,
+ std::unique_ptr<FileSystemInterface> helper);
FileCleanupHandler(const std::string& blobId,
const std::vector<std::string>& files,
- const FileSystemInterface* helper) :
+ std::unique_ptr<FileSystemInterface> helper) :
supported(blobId),
- files(files), helper(helper)
+ files(files), helper(std::move(helper))
{}
~FileCleanupHandler() = default;
@@ -82,7 +83,7 @@
private:
std::string supported;
std::vector<std::string> files;
- const FileSystemInterface* helper;
+ std::unique_ptr<FileSystemInterface> helper;
};
} // namespace ipmi_flash