BaseKeeper(3)
| BaseKeeper(3) | Library Functions Manual | BaseKeeper(3) |
NAME
BaseKeeper - The BaseKeeper class.
SYNOPSIS
#include <BaseKeeper.h>
Inherits UDBase.
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)
Detailed Description
The BaseKeeper class.
This class keeps collection database and contains various methods to work with this database.
Constructor & Destructor Documentation
BaseKeeper::BaseKeeper (const std::shared_ptr< MLBookProc > & mlbp)
BaseKeeper constructor.
Parameters
Member Function Documentation
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).
Parameters
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.
Note
Parameters
UDBase BaseKeeper::getAllFiles ()
Returns all collection files.
Note
Returns
UDBElement BaseKeeper::getBaseAnchorFileName (const std::filesystem::path & base_path) [static]
This method can be used to obtain anchor base path from file, obtained as a result of exportBase() method.
Parameters
Returns
std::filesystem::path BaseKeeper::getBooksDirectory ()
Returns books directory. Valid only for 'inpx' and 'legacy' collections.
Note
Returns
size_t BaseKeeper::getBooksQuantity ()
Returns collection books quantity.
Returns
std::string BaseKeeper::getCollectionType ()
Returns loaded collection type.
Note
Returns
std::filesystem::path BaseKeeper::getCurrentCollectionBasePath ()
Returns loaded collection database file path.
Returns
size_t BaseKeeper::getFilesQuantity ()
Returns collection files quantity.
Returns
void BaseKeeper::importCollectionBase (const std::filesystem::path & source_base_path, const std::filesystem::path & coll_base_path, const std::filesystem::path & anchor_file) [static]
Imports collection database. Valid only for databases obtained by exportBase() method.
Note
Parameters
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.
Returns
void BaseKeeper::loadCollection (const std::filesystem::path & base_path)
Loads collection database to memory.
Note
Parameters
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.
Note
Parameters
coef_coincedence Coefficient of coincidence. Should be more than 0 and less than or equal to 1.0.
Returns
UDBase BaseKeeper::searchBooksWithNotes (const std::shared_ptr< NotesKeeper > & notes)
Searches books with notes in loaded collection database.
Note
Parameters
Returns
void BaseKeeper::unloadCollection ()
Clears collection database.
Author
Generated automatically by Doxygen for MLBookProc from the source code.
| Version 2.1 | MLBookProc |
