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

The NotesKeeper class. More...

#include <NotesKeeper.h>

Inheritance diagram for NotesKeeper:
Collaboration diagram for NotesKeeper:

Public Member Functions

 NotesKeeper (const std::shared_ptr< MLBookProc > &mlbp)
 NotesKeeper constructor.
void loadNotesBase (const std::filesystem::path &base_path)
UDBase searchNotes (const UDBElement &book_search_result)
void addNote (const UDBElement &book_search_result, const std::string &note_txt)
void removeNote (const UDBElement &note)

Detailed Description

The NotesKeeper class.

This class keeps notes databse and provides methods to work with it.

Constructor & Destructor Documentation

◆ NotesKeeper()

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

NotesKeeper constructor.

Parameters
mlbpSmart pointer to MLBookProc object.

Member Function Documentation

◆ addNote()

void NotesKeeper::addNote ( const UDBElement & book_search_result,
const std::string & note_txt )

Creates or edits notes for given book. If note_text is empty, removes notes for given book.

Parameters
book_search_resultBookID::BookSearchResult object.
note_txtNote text.

◆ loadNotesBase()

void NotesKeeper::loadNotesBase ( const std::filesystem::path & base_path)

Loads notes database to memory.

Parameters
base_pathPath to notes database file.

◆ removeNote()

void NotesKeeper::removeNote ( const UDBElement & note)

Removes note.

Parameters
noteBaseID::BookNote object to be removed from database.

◆ searchNotes()

UDBase NotesKeeper::searchNotes ( const UDBElement & book_search_result)

Search notes for given book.

Parameters
book_search_resultBaseID::BookSearchResult object.
Returns
UDBase object containing BaseID::BookNote objects (if any).