NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
Enumerations | |
enum | Type { ARCHIVE_AUTO , ARCHIVE_TAR , ARCHIVE_GZ , ARCHIVE_ZLIB , ARCHIVE_ZIP , ARCHIVE_NONE } |
Functions | |
Type | detectType (const std::string &sArchiveFileName) |
Detects the type of the archive based upon the magic numbers in their header sections or upon the file names extension, if the file does not yet exist. More... | |
static std::string | getGZipFileName (const std::string &sArchiveFileName) |
Static helper function to read a possible available file name in the GZIP header section. More... | |
void | pack (const std::vector< std::string > &vFileList, const std::string &sTargetFile, Type type) |
Pack a set of files or folders into an archive file type with the specified file name. If the type of the archive is not specified then its automatically detected based upon the file extension or from an already existing file at the specified location. More... | |
std::vector< std::string > | unpack (const std::string &sArchiveName, const std::string &sTargetPath) |
Unpacks an archive file format into its folder structure at the specified location. The archive file type is detected automatically. If no target is specified then only the names of the contained files are returned. More... | |
enum Archive::Type |
Enumerator | |
---|---|
ARCHIVE_AUTO | |
ARCHIVE_TAR | |
ARCHIVE_GZ | |
ARCHIVE_ZLIB | |
ARCHIVE_ZIP | |
ARCHIVE_NONE |
Definition at line 27 of file archive.hpp.
Type Archive::detectType | ( | const std::string & | sArchiveFileName | ) |
Detects the type of the archive based upon the magic numbers in their header sections or upon the file names extension, if the file does not yet exist.
sArchiveFileName | const std::string& |
Definition at line 48 of file archive.cpp.
References ARCHIVE_GZ, ARCHIVE_NONE, ARCHIVE_TAR, ARCHIVE_ZIP, ARCHIVE_ZLIB, DetachedLogger::debug(), g_logger, and toLowerCase().
Referenced by pack(), and unpack().
|
static |
Static helper function to read a possible available file name in the GZIP header section.
sArchiveFileName | const std::string& |
Definition at line 109 of file archive.cpp.
Referenced by unpack().
void Archive::pack | ( | const std::vector< std::string > & | vFileList, |
const std::string & | sTargetFile, | ||
Type | type | ||
) |
Pack a set of files or folders into an archive file type with the specified file name. If the type of the archive is not specified then its automatically detected based upon the file extension or from an already existing file at the specified location.
vFileList | const std::vector<std::string>& |
sTargetFile | const std::string& |
type | Type |
Definition at line 168 of file archive.cpp.
References ARCHIVE_AUTO, ARCHIVE_GZ, ARCHIVE_NONE, ARCHIVE_TAR, ARCHIVE_ZIP, DetachedLogger::debug(), detectType(), fileExists(), g_logger, getFileList(), getFolderList(), NumeReKernel::getInstance(), NumeReKernel::getSettings(), SyntaxError::INVALID_FILETYPE, and pack().
Referenced by cmd_pack(), and pack().
std::vector< std::string > Archive::unpack | ( | const std::string & | sArchiveName, |
const std::string & | sTargetPath | ||
) |
Unpacks an archive file format into its folder structure at the specified location. The archive file type is detected automatically. If no target is specified then only the names of the contained files are returned.
sArchiveName | const std::string& |
sTargetPath | const std::string& |
Definition at line 307 of file archive.cpp.
References ARCHIVE_GZ, ARCHIVE_NONE, ARCHIVE_TAR, ARCHIVE_ZIP, ARCHIVE_ZLIB, DetachedLogger::debug(), detectType(), SyntaxError::FILE_NOT_EXIST, fileExists(), g_logger, NumeReKernel::getFileSystem(), getGZipFileName(), NumeReKernel::getInstance(), SyntaxError::INVALID_FILETYPE, replacePathSeparator(), and FileSystem::ValidizeAndPrepareName().
Referenced by cmd_unpack().