Add <functional> to files that use std::function
[lsnes.git] / include / core / moviefile-common.hpp
blobf45aa2f847eb1f725c07ad64f89edd942a71f5b3
1 #ifndef _moviefile_common__hpp__included__
2 #define _moviefile_common__hpp__included__
4 #include <functional>
5 #include "core/moviefile.hpp"
6 #define DEFAULT_RTC_SECOND 1000000000ULL
7 #define DEFAULT_RTC_SUBSECOND 0ULL
9 template<typename target>
10 static void moviefile_write_settings(target& w, const std::map<std::string, std::string>& settings,
11 core_setting_group& sgroup, std::function<void(target& w, const std::string& name,
12 const std::string& value)> writefn)
14 for(auto i : settings) {
15 if(!sgroup.settings.count(i.first))
16 continue;
17 if(sgroup.settings.find(i.first)->second.dflt == i.second)
18 continue;
19 writefn(w, i.first, i.second);
23 struct moviefile_branch_extractor_text : public moviefile::branch_extractor
25 moviefile_branch_extractor_text(const std::string& filename);
26 ~moviefile_branch_extractor_text();
27 std::set<std::string> enumerate();
28 void read(const std::string& name, portctrl::frame_vector& v);
29 private:
30 zip::reader z;
33 struct moviefile_branch_extractor_binary : public moviefile::branch_extractor
35 moviefile_branch_extractor_binary(const std::string& filename);
36 ~moviefile_branch_extractor_binary();
37 std::set<std::string> enumerate();
38 void read(const std::string& name, portctrl::frame_vector& v);
39 private:
40 int s;
43 struct moviefile_sram_extractor_text : public moviefile::sram_extractor
45 moviefile_sram_extractor_text(const std::string& filename);
46 ~moviefile_sram_extractor_text();
47 std::set<std::string> enumerate();
48 void read(const std::string& name, std::vector<char>& v);
49 private:
50 zip::reader z;
53 struct moviefile_sram_extractor_binary : public moviefile::sram_extractor
55 moviefile_sram_extractor_binary(const std::string& filename);
56 ~moviefile_sram_extractor_binary();
57 std::set<std::string> enumerate();
58 void read(const std::string& name, std::vector<char>& v);
59 private:
60 int s;
64 #endif