#include <OpenBook.h>
Public Member Functions | |
OpenBook (const std::shared_ptr< AuxFunc > &af) | |
OpenBook constructor. | |
std::filesystem::path | open_book (const BookBaseEntry &bbe, const bool ©, const std::filesystem::path ©_path, const bool &find_fbd, std::function< void(const std::filesystem::path &path)> open_callback) |
Opens book. | |
The OpenBook class.
This class contains methods for books "opening".
OpenBook::OpenBook | ( | const std::shared_ptr< AuxFunc > & | af | ) |
std::filesystem::path OpenBook::open_book | ( | const BookBaseEntry & | bbe, |
const bool & | copy, | ||
const std::filesystem::path & | copy_path, | ||
const bool & | find_fbd, | ||
std::function< void(const std::filesystem::path &path)> | open_callback ) |
Opens book.
If book is in archive, unpacks book and returns absolute path to unpacked file. Otherwise returns absolute path to book file.
If copy is set to true and copy_path is not empty, creates directory on copy_path and copies book to it.
If find_fbd is set to true, will try to find and open fbd file instead of book.
If open_callback is not nullptr, calls it.
bbe | BookBaseEntry object. |
copy | if set to true, copy of book file will be created. |
copy_path | absolute path to directory book to be copied to. |
find_fbd | if set to true, this method will try to find and open fbd file instead of book. |
open_callback | method to be called at the end of all operations. path argument is an absolute path to method work result. |