Imported version 0.2-1
[mstardict] / src / lib / storage.h
1 #ifndef _STARDICT_RESOURCE_STORAGE_H_
2 #define _STARDICT_RESOURCE_STORAGE_H_
3
4 #include <string>
5
6 class File_ResourceStorage {
7 public:
8         File_ResourceStorage(const char *resdir);
9         const char *get_file_path(const char *key);
10         const char *get_file_content(const char *key);
11 private:
12         std::string resdir;
13         std::string filepath;
14 };
15
16 class Database_ResourceStorage {
17 public:
18         Database_ResourceStorage();
19         bool load(const char *rifofilename);
20         const char *get_file_path(const char *key);
21         const char *get_file_content(const char *key);
22 };
23
24 class ResourceStorage {
25 public:
26         ResourceStorage();
27         ~ResourceStorage();
28         bool load(const char *dirname);
29         int is_file_or_db;
30         const char *get_file_path(const char *key);
31         const char *get_file_content(const char *key);
32 private:
33         File_ResourceStorage *file_storage;
34         Database_ResourceStorage *database_storage;
35 };
36
37 #endif