-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThumbnailCache.h
More file actions
35 lines (27 loc) · 886 Bytes
/
ThumbnailCache.h
File metadata and controls
35 lines (27 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef THUMBNAILCACHE_H
#define THUMBNAILCACHE_H
#include <string>
#include <vector>
#include "sqlite3.h"
#include "Utils.h"
class ThumbnailCache
{
public:
static ThumbnailCache& getInstance() {
static ThumbnailCache instance;
return instance;
}
void getThumbnail(const std::string& filename, FileType fileType, std::vector<uint8_t>& imageData);
void shrinkDatabase();
private:
bool queryImageData(const std::string& filename, FileType fileType, std::vector<uint8_t>& imageData);
bool insertImageData(const std::string& filename, FileType fileType, const std::vector<uint8_t>& imageData);
bool createTable();
ThumbnailCache();
~ThumbnailCache();
ThumbnailCache(const ThumbnailCache&) = delete;
ThumbnailCache& operator=(const ThumbnailCache&) = delete;
private:
sqlite3* m_database;
};
#endif // THUMBNAILCACHE_H