|
Ring Daemon
|
Archiver is used to generate/read encrypted archives. More...
Typedefs | |
| using | FileMatchPair = std::function< std::pair< bool, std::string_view >(std::string_view)> |
Functions | |
| std::vector< uint8_t > | compress (const std::string &str) |
| Compress a STL string using zlib with given compression level and return the binary data. | |
| void | compressGzip (const std::string &str, const std::string &path) |
| Compress string to a Gzip file. | |
| void | compressGzip (const std::vector< uint8_t > &dat, const std::string &path) |
| std::vector< uint8_t > | decompress (const std::vector< uint8_t > &dat) |
| Decompress an STL string using zlib and return the original data. | |
| std::vector< uint8_t > | decompressGzip (const std::string &path) |
| Decompress Gzip file to bytes. | |
| std::vector< std::string > | listFilesFromArchive (const std::string &path) |
| listFilesFromArchive list all files from an archive | |
| gzFile | openGzip (const std::string &path, const char *mode) |
| Open Gzip file (uses wide string version of gzopen on windows) | |
| std::vector< uint8_t > | readFileFromArchive (const std::string &path, const std::string &fileRelativePathName) |
| readFileFromArchive read a file from an archive without uncompressing the whole archive | |
| void | uncompressArchive (const std::string &path, const std::string &dir, const FileMatchPair &f) |
| uncompressArchive Uncompresses an archive and puts the different files in dir folder according to a FileMatchPair f | |
Archiver is used to generate/read encrypted archives.
| using jami::archiver::FileMatchPair = typedef std::function<std::pair<bool, std::string_view>(std::string_view)> |
Definition at line 37 of file archiver.h.
Compress a STL string using zlib with given compression level and return the binary data.
Definition at line 51 of file archiver.cpp.
References compress(), and jami::emitSignal().
Referenced by compress(), and jami::fileutils::writeArchive().

Compress string to a Gzip file.
Definition at line 66 of file archiver.cpp.
References jami::emitSignal(), and openGzip().
Referenced by jami::fileutils::writeArchive().

Definition at line 74 of file archiver.cpp.
References jami::emitSignal(), and openGzip().

Decompress an STL string using zlib and return the original data.
Definition at line 101 of file archiver.cpp.
References jami::emitSignal().
Referenced by jami::fileutils::readArchive().

Decompress Gzip file to bytes.
Definition at line 82 of file archiver.cpp.
References jami::emitSignal(), and openGzip().

| std::vector< std::string > jami::archiver::listFilesFromArchive | ( | const std::string & | path | ) |
listFilesFromArchive list all files from an archive
| path | archive path |
Definition at line 417 of file archiver.cpp.
References jami::emitSignal().
Referenced by jami::JamiPluginManager::checkPluginSignatureFile().

Open Gzip file (uses wide string version of gzopen on windows)
Definition at line 142 of file archiver.cpp.
References jami::emitSignal().
Referenced by compressGzip(), compressGzip(), and decompressGzip().

| std::vector< uint8_t > jami::archiver::readFileFromArchive | ( | const std::string & | path, |
| const std::string & | fileRelativePathName | ||
| ) |
readFileFromArchive read a file from an archive without uncompressing the whole archive
| path | archive path |
| fileRelativePathName | file path relative path name in the archive E.g: data/myfile.txt inside the archive |
Definition at line 329 of file archiver.cpp.
References jami::emitSignal().
Referenced by jami::JamiPluginManager::checkPluginSignatureValidity(), jami::PluginUtils::readPluginCertificateFromArchive(), jami::PluginUtils::readPluginManifestFromArchive(), jami::PluginUtils::readPluginSignatureFromArchive(), and jami::PluginUtils::readSignatureFileFromArchive().

| void jami::archiver::uncompressArchive | ( | const std::string & | path, |
| const std::string & | dir, | ||
| const FileMatchPair & | f | ||
| ) |
uncompressArchive Uncompresses an archive and puts the different files in dir folder according to a FileMatchPair f
| path | |
| dir | |
| f | takes a filename relative path inside the archive like mysubfolder/myfile and returns a pair (bool, new filename relative path) Where the bool indicates if we should uncompress this file and the new filename relative path puts the file in the directory dir under a different relative path name like mynewsubfolder/myfile |
Definition at line 200 of file archiver.cpp.
References DIR_SEPARATOR_CH, DIR_SEPARATOR_STR, and jami::emitSignal().
Referenced by jami::JamiPluginManager::installPlugin().
