The ARCHParser class. More...
#include <ARCHParser.h>
Public Member Functions | |
ARCHParser (const std::shared_ptr< AuxFunc > &af, const bool &rar_support) | |
ARCHParser constructor. | |
virtual | ~ARCHParser () |
ARCHParser destructor. | |
std::vector< BookParseEntry > | arch_parser (const std::filesystem::path &filepath) |
This method carries out actual parsing. | |
void | stopAll () |
Stops all operations. | |
![]() | |
LibArchive (const std::shared_ptr< AuxFunc > &af) | |
LibArchive constructor. | |
std::filesystem::path | unpackByPosition (const std::filesystem::path &archaddress, const std::filesystem::path &outfolder, const ArchEntry &entry) |
Unpacks single entry content from zip archive. | |
std::string | unpackByPositionStr (const std::filesystem::path &archaddress, const ArchEntry &entry) |
Unpacks single entry content from zip archive. | |
std::filesystem::path | unpackByFileNameStream (const std::filesystem::path &archaddress, const std::filesystem::path &outfolder, const std::string &filename) |
Unpacks entry content from archive. | |
std::string | unpackByFileNameStreamStr (const std::filesystem::path &archaddress, const std::string &filename) |
Unpacks entry content from archive. | |
int | fileNames (const std::filesystem::path &filepath, std::vector< ArchEntry > &filenames) |
Lists all entries in archive file. | |
int | fileNamesStream (const std::filesystem::path &address, std::vector< ArchEntry > &filenames) |
Lists all entries in archive file. | |
ArchEntry | fileinfo (const std::filesystem::path &address, const std::string &filename) |
Returns ArchEntry for particular file or directory in archive. | |
int | libarchive_packing (const std::filesystem::path &sourcepath, const std::filesystem::path &outpath) |
Packs file or directory into archive. | |
int | libarchive_packing (const std::shared_ptr< archive > &a, const std::filesystem::path &sourcepath, const bool &rename_source, const std::string &new_source_name) |
Packs file or directory into archive. | |
ArchiveRemoveEntry | libarchive_remove_init (const std::filesystem::path &sourcepath, const std::filesystem::path &outpath) |
Initializes archive objects for removing entries from archive. | |
int | libarchive_remove_entry (ArchiveRemoveEntry rm_e, const std::vector< ArchEntry > &to_remove) |
Removes entry from archive. | |
void | libarchive_error (const std::shared_ptr< archive > &a, const std::string &message, const int &error_number) |
Prints libarchive error messages. | |
std::string | libarchive_read_entry_str (archive *a, archive_entry *entry) |
Reads archived file to stirng. | |
int | libarchive_write_data (archive *a, const std::string &data) |
Writes data to archive. | |
std::shared_ptr< ArchiveFileEntry > | createArchFile (const std::filesystem::path &archaddress, const la_int64_t &position=la_int64_t(0)) |
Creates ArchiveFileEntry object. | |
std::shared_ptr< archive > | libarchive_read_init (std::shared_ptr< ArchiveFileEntry > fl) |
Initializes archive reading. | |
std::shared_ptr< archive > | libarchive_read_init_fallback (std::shared_ptr< ArchiveFileEntry > fl) |
Initializes archive reading. | |
std::filesystem::path | libarchive_read_entry (archive *a, archive_entry *entry, const std::filesystem::path &outfolder) |
Unpacks libarchive entry content. | |
std::shared_ptr< archive > | libarchive_write_init (const std::filesystem::path &outpath) |
Initializes writing to archive. | |
int | writeToArchive (std::shared_ptr< archive > a, const std::filesystem::path &source, const std::filesystem::path &path_in_arch) |
Writes file or directory to archive. | |
int | libarchive_write_directory (archive *a, archive_entry *entry, const std::filesystem::path &path_in_arch, const std::filesystem::path &source) |
Writes directory to archive. | |
int | libarchive_write_file (archive *a, archive_entry *entry, const std::filesystem::path &path_in_arch, const std::filesystem::path &source) |
Writes file to archive. | |
int | libarchive_write_data_from_file (archive *a, const std::filesystem::path &source) |
Writes raw data from file to archive. | |
The ARCHParser class.
Class for archives parsing. In most cases you do not need to use this class directly. Use CreateCollection or RefreshCollection instead.
ARCHParser::ARCHParser | ( | const std::shared_ptr< AuxFunc > & | af, |
const bool & | rar_support ) |
ARCHParser constructor.
af | smart pointer to AuxFunc object. |
rar_support | if true, ARCHParser will parse rar archives, otherwise not. |
std::vector< BookParseEntry > ARCHParser::arch_parser | ( | const std::filesystem::path & | filepath | ) |
This method carries out actual parsing.
Call this method to start archive parsing.
filepath | absolute path to archive. |