29 lines
1010 B
C++
29 lines
1010 B
C++
#ifndef TJDUIAPP_EBOOK_MODEL
|
|
#define TJDUIAPP_EBOOK_MODEL
|
|
|
|
#include "TjdUiAppEbookPresenter.h"
|
|
#include "ui_view_group.h"
|
|
|
|
namespace TJD {
|
|
|
|
class TjdUiAppEbookModel
|
|
{
|
|
public:
|
|
TjdUiAppEbookModel() {}
|
|
~TjdUiAppEbookModel() {}
|
|
static TjdUiAppEbookModel &GetInstance(void);
|
|
|
|
bool LoadBooksFromJson(const char *filename, std::list<EbookItem> &books);
|
|
void SaveBooksToJson(const char *filename, const std::list<EbookItem> &books);
|
|
void ScanAndUpdateBooks(const char *dirname, std::list<EbookItem> &books);
|
|
void WriteEbookSizesToBinFile(std::string name, const std::vector<uint32_t> &sizes, const char *path);
|
|
std::vector<uint32_t> ReadEbookSizesFromBinFile(std::string name, const char*path, size_t startElement,
|
|
size_t count);
|
|
bool deleteBookById(const char *jsonFilePath, int id);
|
|
void SaveItemBookToJson(const char *filename, const EbookItem itemToUpdate);
|
|
|
|
private:
|
|
};
|
|
|
|
} // namespace TJD
|
|
#endif |