forked from jjgod/mac-dictionary-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage.h
37 lines (32 loc) · 852 Bytes
/
storage.h
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
36
37
#ifndef _STARDICT_RESOURCE_STORAGE_H_
#define _STARDICT_RESOURCE_STORAGE_H_
#include <string>
class File_ResourceStorage {
public:
File_ResourceStorage(const char *resdir);
const char *get_file_path(const char *key);
const char *get_file_content(const char *key);
private:
std::string resdir;
std::string filepath;
};
class Database_ResourceStorage {
public:
Database_ResourceStorage();
bool load(const char *rifofilename);
const char *get_file_path(const char *key);
const char *get_file_content(const char *key);
};
class ResourceStorage {
public:
ResourceStorage();
~ResourceStorage();
bool load(const char *dirname);
int is_file_or_db;
const char *get_file_path(const char *key);
const char *get_file_content(const char *key);
private:
File_ResourceStorage *file_storage;
Database_ResourceStorage *database_storage;
};
#endif