#include <ArchiveWrapper.h>
|
virtual | ~ArchiveWrapper ()=default |
|
size_t | sizeOfArchive (const std::string &fileName) |
|
bool | unpack (const std::string &fileName, const std::string &destFolder, alexaClientSDK::avsCommon::utils::filesystem::Permissions directoryPermission=alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_DIRECTORY_PERMISSIONS, alexaClientSDK::avsCommon::utils::filesystem::Permissions filePermission=alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_FILE_PERMISSIONS) |
|
bool | unpack (struct archive *reader, struct archive *writer, const std::string &destFolder, alexaClientSDK::avsCommon::utils::filesystem::Permissions directoryPermission=alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_DIRECTORY_PERMISSIONS, alexaClientSDK::avsCommon::utils::filesystem::Permissions filePermission=alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_FILE_PERMISSIONS) |
|
Wraps the libarchive library as libarchive is not thread-safe. One one libarchive operation could happen at a given time.
◆ ~ArchiveWrapper()
virtual alexaClientSDK::acsdkAssets::common::ArchiveWrapper::~ArchiveWrapper |
( |
| ) |
|
|
virtualdefault |
◆ getInstance()
static std::shared_ptr<ArchiveWrapper> alexaClientSDK::acsdkAssets::common::ArchiveWrapper::getInstance |
( |
| ) |
|
|
static |
Return an instance of this class. There should be only one instance of this class.
- Returns
- an instance of this class, create one if it did not exist.
◆ sizeOfArchive()
size_t alexaClientSDK::acsdkAssets::common::ArchiveWrapper::sizeOfArchive |
( |
const std::string & |
fileName | ) |
|
Get the total size of the contents of an archive when uncompressed. NOT the size of the archive on disk.
- Parameters
-
fileName | of the archive to get the size of. |
- Returns
- size of the given archive, or SIZE_MAX if an error occurs.
◆ unpack() [1/2]
bool alexaClientSDK::acsdkAssets::common::ArchiveWrapper::unpack |
( |
const std::string & |
fileName, |
|
|
const std::string & |
destFolder, |
|
|
alexaClientSDK::avsCommon::utils::filesystem::Permissions |
directoryPermission = alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_DIRECTORY_PERMISSIONS , |
|
|
alexaClientSDK::avsCommon::utils::filesystem::Permissions |
filePermission = alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_FILE_PERMISSIONS |
|
) |
| |
Uncompresses a given tar.gz or zip or other compression formats supported by libarchive into the destination folder
- Parameters
-
fileName | name of compressed file |
destFolder | directory to place on. Must end in / |
directoryPermission | OPTIONAL, permissions to use for the unpacked directories |
filePermission | OPTIONAL, permissions to use for the unpacked files |
◆ unpack() [2/2]
bool alexaClientSDK::acsdkAssets::common::ArchiveWrapper::unpack |
( |
struct archive * |
reader, |
|
|
struct archive * |
writer, |
|
|
const std::string & |
destFolder, |
|
|
alexaClientSDK::avsCommon::utils::filesystem::Permissions |
directoryPermission = alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_DIRECTORY_PERMISSIONS , |
|
|
alexaClientSDK::avsCommon::utils::filesystem::Permissions |
filePermission = alexaClientSDK::avsCommon::utils::filesystem::DEFAULT_FILE_PERMISSIONS |
|
) |
| |
Uncompresses a given tar.gz or zip or other compression formats supported by libarchive into the destination folder
- Parameters
-
readArchive | archive object that read archived data |
writeArchive | archive object that write unpacked data |
destFolder | directory to place unpacked data in. Must not end in / |
directoryPermission | OPTIONAL, permissions to use for the unpacked directories |
filePermission | OPTIONAL, permissions to use for the unpacked files |
The documentation for this class was generated from the following file:
- /workplace/avs-device-sdk/capabilities/DavsClient/acsdkAssetsCommon/include/acsdkAssetsCommon/ArchiveWrapper.h
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0