MLBookProc 2.1
Loading...
Searching...
No Matches
BookmarksKeeper Class Reference

The BookmarksKeeper class. More...

#include <BookmarksKeeper.h>

Inheritance diagram for BookmarksKeeper:
Collaboration diagram for BookmarksKeeper:

Public Member Functions

 BookmarksKeeper (const std::shared_ptr< MLBookProc > &mlbp)
 BookmarksKeeper constructor.
void loadBookmarksBase (const std::filesystem::path &bookmarks_base_path)
void addToBookmarks (const UDBElement &book_search_result)
void removeBookmark (const UDBElement &bookmark)
std::shared_mutex * getRawMutex ()

Detailed Description

The BookmarksKeeper class.

This class contains bookmarks database and methods to work with it. See also LibUDB documentation.

Constructor & Destructor Documentation

◆ BookmarksKeeper()

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

BookmarksKeeper constructor.

Parameters
mlbpSmart pointer to MLBookProc object.

Member Function Documentation

◆ addToBookmarks()

void BookmarksKeeper::addToBookmarks ( const UDBElement & book_search_result)

Adds book to bookmarks.

Parameters
book_search_resultUDBElement of BaseID::BookSearchResult type.

◆ getRawMutex()

std::shared_mutex * BookmarksKeeper::getRawMutex ( )

Returns pointer to internal mutex used to block bookmarks database calls.

Returns
Pointer to std::shared_mutex object.

◆ loadBookmarksBase()

void BookmarksKeeper::loadBookmarksBase ( const std::filesystem::path & bookmarks_base_path)

Loads bookmarks database to memory.

Note
This method can throw std::exception in case of errors.
Parameters
bookmarks_base_pathPath to bookmarks database.

◆ removeBookmark()

void BookmarksKeeper::removeBookmark ( const UDBElement & bookmark)

Removes bookmark from database.

Parameters
bookmarkUDBElement of BaseID::BookMark type.