MLBookProc 2.1
Loading...
Searching...
No Matches
NotesKeeper.h
1/*
2 * Copyright (C) 2026 Yury Bobylev <bobilev_yury@mail.ru>
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation, version 3.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16#ifndef NOTESKEEPER_H
17#define NOTESKEEPER_H
18
19#include <BaseID.h>
20#include <MLBookProc.h>
21#include <UDBase.h>
22#include <shared_mutex>
23
29class NotesKeeper : public UDBase
30{
31public:
36 NotesKeeper(const std::shared_ptr<MLBookProc> &mlbp);
37
43 void
44 loadNotesBase(const std::filesystem::path &base_path);
45
52 UDBase
53 searchNotes(const UDBElement &book_search_result);
54
62 void
63 addNote(const UDBElement &book_search_result, const std::string &note_txt);
64
70 void
71 removeNote(const UDBElement &note);
72
73private:
74 void
75 loadLegacyBase(const std::filesystem::path &base_path);
76
77 void
78 parseLegacyEntry(const std::string &entry);
79
80 std::shared_ptr<MLBookProc> mlbp;
81
82 std::filesystem::path base_path;
83
84 BaseID bid;
85
86 std::shared_mutex base_mtx;
87};
88#endif // NOTESKEEPER_H
The BaseID class.
Definition BaseID.h:28
UDBase searchNotes(const UDBElement &book_search_result)
void loadNotesBase(const std::filesystem::path &base_path)
void removeNote(const UDBElement &note)
NotesKeeper(const std::shared_ptr< MLBookProc > &mlbp)
NotesKeeper constructor.
void addNote(const UDBElement &book_search_result, const std::string &note_txt)