Lua: Fix type confusion between signed and unsigned
[lsnes.git] / include / library / filelist.hpp
blob25b919124be89a76c30ae2cda34e15f24f517417
1 #ifndef _library__filelist__hpp__included__
2 #define _library__filelist__hpp__included__
4 #include <map>
5 #include <set>
6 #include <string>
8 /**
9 * List of files.
11 class filelist
13 public:
14 /**
15 * Create a new list, backed by specific file.
17 filelist(const std::string& backingfile, const std::string& directory);
18 /**
19 * Dtor.
21 ~filelist();
22 /**
23 * Enumerate the files on the list. Files that don't have matching timestamp are auto-removed.
25 std::set<std::string> enumerate();
26 /**
27 * Add a file to the list. Current timestamp is used to mark version.
29 void add(const std::string& filename);
30 /**
31 * Remove a file from the list.
33 void remove(const std::string& filename);
34 /**
35 * Rename a file from the list.
37 void rename(const std::string& oldname, const std::string& newname);
38 private:
39 filelist(const filelist&);
40 filelist& operator=(const filelist&);
41 std::map<std::string, int64_t> readfile();
42 void check_stale(std::map<std::string, int64_t>& data);
43 void writeback(const std::map<std::string, int64_t>& data);
44 std::string backingfile;
45 std::string directory;
48 #endif