The BaseKeeper class.
More...
#include <BaseKeeper.h>
|
static std::filesystem::path | get_books_path (const std::string &collection_name, const std::shared_ptr< AuxFunc > &af) |
| Returns absolute path to directory containing collection books.
|
|
The BaseKeeper class.
This class is intended to keep and operate collections databases. loadCollection() method should be called first.
◆ BaseKeeper()
BaseKeeper::BaseKeeper |
( |
const std::shared_ptr< AuxFunc > & | af | ) |
|
◆ booksWithNotes()
Lists all books of current collection, which have notes.
- Parameters
-
notes | vector of notes (see NotesKeeper class documentation). |
- Returns
- Vector of books with notes.
◆ collectionAuthors()
std::vector< std::string > BaseKeeper::collectionAuthors |
( |
| ) |
|
Lists all authors, found in collection.
- Returns
- Vector containing UTF-8 author's names strings.
◆ get_base_vector()
Returns copy of inner database vector.
- Returns
- Database vector.
◆ get_books_path()
static std::filesystem::path BaseKeeper::get_books_path |
( |
const std::string & | collection_name, |
|
|
const std::shared_ptr< AuxFunc > & | af ) |
|
static |
Returns absolute path to directory containing collection books.
This method can be called without collection loading to memory.
- Note
- This method can throw MLException in case of errors.
- Parameters
-
collection_name | collection name. |
af | smart pointer to AuxFunc object. |
- Returns
- Absolute path to books directory.
◆ loadCollection()
void BaseKeeper::loadCollection |
( |
const std::string & | col_name | ) |
|
Loads collection database to memory.
- Note
- This method can throw MLException in case of errors.
- Parameters
-
◆ searchBook()
Searches book in collection.
BookBaseEntry object must be provided as search request. It is necessary to fill in any field in the inner BookParseEntry object to receive particular result. Otherwise complete collection book list will be returned.
- Parameters
-
- Returns
- Vector of BookBaseEntry objects, containing search results.