|
MLBookProc 2.1
|
The BaseKeeper class. More...
#include <BaseKeeper.h>


Public Member Functions | |
| BaseKeeper (const std::shared_ptr< MLBookProc > &mlbp) | |
| BaseKeeper constructor. | |
| void | loadCollection (const std::filesystem::path &base_path) |
| size_t | getBooksQuantity () |
| size_t | getFilesQuantity () |
| UDBase | searchBook (const std::vector< UDBElement > &requests, const double &coef_coincedence) |
| void | cancelSearch () |
| std::string | getCollectionType () |
| std::filesystem::path | getBooksDirectory () |
| void | editBookEntry (const UDBElement &book_search_result) |
| UDBase | searchBooksWithNotes (const std::shared_ptr< NotesKeeper > ¬es) |
| UDBase | getAllFiles () |
| UDBase | listAllAuthors () |
| void | exportBase (const std::filesystem::path &result_path) |
| std::filesystem::path | getCurrentCollectionBasePath () |
| void | unloadCollection () |
Static Public Member Functions | |
| static UDBElement | getBaseAnchorFileName (const std::filesystem::path &base_path) |
| static void | importCollectionBase (const std::filesystem::path &source_base_path, const std::filesystem::path &coll_base_path, const std::filesystem::path &anchor_file) |
The BaseKeeper class.
This class keeps collection database and contains various methods to work with this database.
| BaseKeeper::BaseKeeper | ( | const std::shared_ptr< MLBookProc > & | mlbp | ) |
BaseKeeper constructor.
| mlbp | Smart pointer to MLBookProc object. |
| void BaseKeeper::cancelSearch | ( | ) |
Interrupts all search operations.
| void BaseKeeper::editBookEntry | ( | const UDBElement & | book_search_result | ) |
Edits book entry in database (book file or book file path will not be modified).
| book_search_result | UDBElement of BaseID::BookSearchResult type with edited values. |
| void BaseKeeper::exportBase | ( | const std::filesystem::path & | result_path | ) |
Exports loaded collection database to file. This method should be used if you want share your collection database.
| result_path | Absolute path to file of result. |
| UDBase BaseKeeper::getAllFiles | ( | ) |
Returns all collection files.
|
static |
This method can be used to obtain anchor base path from file, obtained as a result of exportBase() method.
| base_path | Path to base file. |
| std::filesystem::path BaseKeeper::getBooksDirectory | ( | ) |
Returns books directory. Valid only for 'inpx' and 'legacy' collections.
| size_t BaseKeeper::getBooksQuantity | ( | ) |
Returns collection books quantity.
| std::string BaseKeeper::getCollectionType | ( | ) |
Returns loaded collection type.
| std::filesystem::path BaseKeeper::getCurrentCollectionBasePath | ( | ) |
Returns loaded collection database file path.
| size_t BaseKeeper::getFilesQuantity | ( | ) |
Returns collection files quantity.
|
static |
Imports collection database. Valid only for databases obtained by exportBase() method.
| source_base_path | Path to base which should be imported. |
| coll_base_path | Path to base which should be created as a result. |
| anchor_file | Absolute path to anchor file, obtained by getBaseAnchorFileName() method. |
| UDBase BaseKeeper::listAllAuthors | ( | ) |
Collects all loaded collection authors.
| void BaseKeeper::loadCollection | ( | const std::filesystem::path & | base_path | ) |
Loads collection database to memory.
| base_path | Path to collection database file. |
| UDBase BaseKeeper::searchBook | ( | const std::vector< UDBElement > & | requests, |
| const double & | coef_coincedence ) |
Searches books in loaded base.
requests vector can contain objects of following types: BaseID::Author, BaseID::BookTitle, BaseID::Sequence, BaseID::Genre.
| requests | Search parameters. |
| coef_coincedence | Coefficient of coincidence. Should be more than 0 and less than or equal to 1.0. |
| UDBase BaseKeeper::searchBooksWithNotes | ( | const std::shared_ptr< NotesKeeper > & | notes | ) |
Searches books with notes in loaded collection database.
| notes | Smart pointer to NotesKeeper object. |
| void BaseKeeper::unloadCollection | ( | ) |
Clears collection database.