initial commit
[ld37_one_room] / src / datamap.h
1 #ifndef DATAMAP_H_
2 #define DATAMAP_H_
3
4 #include <vector>
5 #include <map>
6 #include <string>
7
8 class DataMap {
9         std::vector<std::pair<std::string, std::string>> dmap;
10         mutable std::map<std::string, std::string> cache;
11         std::string root;
12
13 public:
14         void clear();
15
16         void set_path(const char *path);
17
18         bool load_map(const char *fname);
19         void map(const char *match, const char *path);
20
21         int lookup(const char *in, char *buf, int bsz) const;
22         int path_size(const char *in) const;
23 };
24
25 #endif  // DATAMAP_H_