OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
Utils::ArchiveExtractor Class Reference

#include <ArchiveExtractor.h>

Public Types

enum class  e7zExitCode {
  Success = 0 , Warning = 1 , FatalError = 2 , CommandLineError = 7 ,
  NotEnoughMemory = 8 , UserStopped = 255
}
 

Public Member Functions

 ArchiveExtractor (const std::string &path, bool bExtractLzmaInProc=false, bool bExtractLzmaUsing7Zip=true)
 
std::filesystem::path GetPath () const
 
std::string GetExtractionDirectory () const
 
bool Extract ()
 
bool Extract (const std::string &destinationPath)
 

Static Public Member Functions

static bool IsArchiveTypeSupported (const std::filesystem::path &file)
 
static bool IsArchiveTypeSupported (const std::string &file)
 
static std::filesystem::path getUncompressedFilePath (const std::filesystem::path &directory, const std::string &filename)
 
static bool CompressDir (const std::string &srcDir, const std::string &destDir, const std::string &archiveName, std::string &fileOut, CompressionType type=CompressionType::TarGzip)
 

Static Public Attributes

static constexpr bool ALLOW_ALL_ARCHIVE_EXTENSION_TYPES = false
 
static constexpr const char * SupportedExtensions [] = { "tgz", "tar.gz", "gz", "zip", "Z", "gzip", "tar" }
 

Detailed Description

Definition at line 12 of file ArchiveExtractor.h.

Member Enumeration Documentation

◆ e7zExitCode

Enumerator
Success 
Warning 
FatalError 
CommandLineError 
NotEnoughMemory 
UserStopped 

Definition at line 16 of file ArchiveExtractor.h.

Constructor & Destructor Documentation

◆ ArchiveExtractor()

Utils::ArchiveExtractor::ArchiveExtractor ( const std::string &  path,
bool  bExtractLzmaInProc = false,
bool  bExtractLzmaUsing7Zip = true 
)

Definition at line 16 of file ArchiveExtractor.cpp.

Member Function Documentation

◆ CompressDir()

bool Utils::ArchiveExtractor::CompressDir ( const std::string &  srcDir,
const std::string &  destDir,
const std::string &  archiveName,
std::string &  fileOut,
CompressionType  type = CompressionType::TarGzip 
)
static

Definition at line 210 of file ArchiveExtractor.cpp.

Here is the call graph for this function:

◆ Extract() [1/2]

bool Utils::ArchiveExtractor::Extract ( )

Definition at line 54 of file ArchiveExtractor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Extract() [2/2]

bool Utils::ArchiveExtractor::Extract ( const std::string &  destinationPath)

Definition at line 112 of file ArchiveExtractor.cpp.

Here is the call graph for this function:

◆ GetExtractionDirectory()

std::string Utils::ArchiveExtractor::GetExtractionDirectory ( ) const

Definition at line 28 of file ArchiveExtractor.cpp.

Here is the caller graph for this function:

◆ GetPath()

path Utils::ArchiveExtractor::GetPath ( ) const

Definition at line 23 of file ArchiveExtractor.cpp.

◆ getUncompressedFilePath()

path Utils::ArchiveExtractor::getUncompressedFilePath ( const std::filesystem::path &  directory,
const std::string &  filename 
)
static

Definition at line 151 of file ArchiveExtractor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsArchiveTypeSupported() [1/2]

static bool Utils::ArchiveExtractor::IsArchiveTypeSupported ( const std::filesystem::path &  file)
static
Here is the caller graph for this function:

◆ IsArchiveTypeSupported() [2/2]

bool Utils::ArchiveExtractor::IsArchiveTypeSupported ( const std::string &  file)
static

Definition at line 49 of file ArchiveExtractor.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ ALLOW_ALL_ARCHIVE_EXTENSION_TYPES

constexpr bool Utils::ArchiveExtractor::ALLOW_ALL_ARCHIVE_EXTENSION_TYPES = false
inlinestaticconstexpr

Definition at line 44 of file ArchiveExtractor.h.

◆ SupportedExtensions

constexpr const char* Utils::ArchiveExtractor::SupportedExtensions[] = { "tgz", "tar.gz", "gz", "zip", "Z", "gzip", "tar" }
inlinestaticconstexpr

Definition at line 45 of file ArchiveExtractor.h.


The documentation for this class was generated from the following files: