Lab1
Loading...
Searching...
No Matches
NoteRepository Class Reference

Центральний репозиторій для керування даними (Repository Pattern). More...

#include <note_repository.h>

Public Member Functions

 NoteRepository (std::unique_ptr< IStorageStrategy > strategy)
 Конструктор. Приймає стратегію збереження.
 
void addSchema (const Schema &schema)
 
const QList< Schema > & getSchemas () const
 
void removeSchema (int index)
 
void updateSchema (int index, const Schema &schema)
 
void addNote (const Note &note)
 
QList< Note > & getNotes ()
 
void removeNote (int index)
 
void updateNote (int index, const Note &note)
 
void sortNotes (SortType type)
 
void addUsageTime (int seconds)
 
QMap< QString, int > getUsageStats () const
 
bool save (const QString &filePath)
 
bool load (const QString &filePath)
 
void setStrategy (std::unique_ptr< IStorageStrategy > newStrategy)
 Змінює стратегію збереження "на льоту".
 

Detailed Description

Центральний репозиторій для керування даними (Repository Pattern).

Клас відповідає за CRUD операції над нотатками та схемами. Він ізолює логіку збереження, делегуючи її об'єкту IStorageStrategy. Також містить бізнес-логіку експорту та імпорту.

Constructor & Destructor Documentation

◆ NoteRepository()

NoteRepository::NoteRepository ( std::unique_ptr< IStorageStrategy strategy)
explicit

Конструктор. Приймає стратегію збереження.

Parameters
strategyУнікальний вказівник на конкретну реалізацію збереження.

The documentation for this class was generated from the following files: