RemoveBook(3)

RemoveBook(3) Library Functions Manual RemoveBook(3)

NAME

RemoveBook - The RemoveBook class.

SYNOPSIS

#include <RemoveBook.h>

Inherits LibArchive.

Public Member Functions


RemoveBook (const std::shared_ptr< MLBookProc > &mlbp)
RemoveBook constructor. void removeBook (const std::filesystem::path &base_path, const UDBElement &book_search_result)

Public Member Functions inherited from LibArchive
LibArchive (const std::shared_ptr< MLBookProc > &mlbp)
LibArchive constructor. void listFilesInArchive (const std::filesystem::path &archive_path, std::vector< std::tuple< std::string, uint64_t, uint64_t > > &result)
void listFilesInArchiveBuffer (const std::string &buffer, std::vector< std::tuple< std::string, uint64_t, uint64_t > > &result)
void listFilesInZip (const std::filesystem::path &archive_path, std::vector< std::tuple< std::string, uint64_t, uint64_t > > &result)
void listFilesInZipBuffer (const std::string &buffer, std::vector< std::tuple< std::string, uint64_t, uint64_t > > &result)
std::filesystem::path unpackFileToDirectory (const std::filesystem::path &archive_path, const std::string &filename, const std::filesystem::path &directory, const size_t &offset=size_t(0))
std::filesystem::path unpackBufferFileToDirectory (const std::string &buffer, const std::string &filename, const std::filesystem::path &directory, const size_t &offset=size_t(0))
std::filesystem::path unpackZipFileToDirectory (const std::filesystem::path &archive_path, const std::string &filename, const std::filesystem::path &directory)
std::filesystem::path unpackZipBufferFileToDirectory (const std::string &buffer, const std::string &filename, const std::filesystem::path &directory)
std::string unpackFileToBuffer (const std::filesystem::path &archive_path, const std::string &filename, const size_t &offset=size_t(0))
std::string unpackBufferFileToBuffer (const std::string &buffer, const std::string &filename, const size_t &offset=size_t(0))
std::string unpackZipFileToBuffer (const std::filesystem::path &archive_path, const std::string &filename)
std::string unpackZipBufferFileToBuffer (const std::string &buffer, const std::string &filename)
void writeToArchive (const std::filesystem::path &source_object, const std::filesystem::path &archive_path, std::string name_in_archive, const std::filesystem::perms &perms=std::filesystem::perms::none, const bool &overwrite_existing=true)
void writeBufferObjectToArchive (const std::string &buffer, const std::filesystem::path &archive_path, std::string name_in_archive, const std::filesystem::perms &perms, const bool &overwrite_existing)

Public Attributes


std::function< void(double processed, double total)> signal_parsing_progress

Additional Inherited Members

Protected Member Functions inherited from LibArchive
std::shared_ptr< archive > initForReading (const std::shared_ptr< LibArchiveFileData > &fd)
std::shared_ptr< archive > initForWriting (const std::shared_ptr< LibArchiveFileData > &fd)
void archiveError (const std::shared_ptr< archive > &a, const std::string &message)
std::filesystem::path unpackToDirectory (std::shared_ptr< LibArchiveFileData > fd, const std::string &filename, const std::filesystem::path &directory)
void unpackToBuffer (std::shared_ptr< LibArchiveFileData > fd, const std::string &filename, std::string &result)
void unpackEntryToDirectory (std::shared_ptr< archive > a, std::shared_ptr< archive_entry > e, const std::filesystem::path &file_path)
std::string unpackEntryToBuffer (std::shared_ptr< archive > a, std::shared_ptr< archive_entry > e)
void writeFile (std::shared_ptr< archive > a, const std::filesystem::path &path, std::string name_in_archive, const std::filesystem::perms &perms)
void writeBufferToArchive (std::shared_ptr< archive > a, std::shared_ptr< archive_entry > e, const std::string &buf)
std::filesystem::perms getPermissionsFromEntry (const std::shared_ptr< archive_entry > &e)
void setUsernameGroupname (std::shared_ptr< archive_entry > e)

Static Protected Member Functions inherited from LibArchive
static int openCallBack (archive *a, void *client_data)
static la_ssize_t readCallBack (archive *a, void *client_data, const void **buffer)
static la_int64_t skipCallback (archive *a, void *client_data, la_int64_t request)
static int closeCallback (archive *a, void *client_data)
static la_int64_t seekCallback (archive *a, void *client_data, la_int64_t offset, int whence)
static la_ssize_t writeCallback (archive *a, void *client_data, const void *buffer, size_t length)

Protected Attributes inherited from LibArchive
std::shared_ptr< MLBookProc > mlbp

Detailed Description

The RemoveBook class.

This class contains methods for removing books from collections.

Constructor & Destructor Documentation

RemoveBook::RemoveBook (const std::shared_ptr< MLBookProc > & mlbp)

RemoveBook constructor.

Parameters

mlbp Smart pointer to MLBookProc object.

Member Function Documentation

void RemoveBook::removeBook (const std::filesystem::path & base_path, const UDBElement & book_search_result)

Removes book from collection database and filesystem.

Note

This method can throw std::exception in case of errors.

Warning

If book is packed in rar archive, whole archive will be removed.

Parameters

base_path Path to collection database file.
book_search_result BookID::BookSearchResult object.

Member Data Documentation

std::function<void(double processed, double total)> RemoveBook::signal_parsing_progress

If book was packed in archive, archive file will be reparsed after removing. This callback idicates parsing progress if set.

Author

Generated automatically by Doxygen for MLBookProc from the source code.

Version 2.1 MLBookProc