summaryrefslogtreecommitdiff
path: root/community/performous/boost-filesystem-v3.patch
blob: 22dd072132baf2a37ae92e8da6122b0f60266f11 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 7fd3cd0..cdedefb 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -55,8 +55,13 @@ void Backgrounds::reload_internal(fs::path const& parent) {
 		for (fs::directory_iterator dirIt(parent), dirEnd; m_loading && dirIt != dirEnd; ++dirIt) {
 			fs::path p = dirIt->path();
 			if (fs::is_directory(p)) { reload_internal(p); continue; }
+#if BOOST_FILESYSTEM_VERSION < 3
 			std::string name = p.leaf(); // File basename
 			std::string path = p.directory_string(); // Path without filename
+#else
+			std::string name = p.filename().string(); // File basename
+			std::string path = p.string(); // Path without filename
+#endif
 			path.erase(path.size() - name.size());
 			if (!regex_match(name.c_str(), match, expression)) continue;
 			{
diff --git a/game/cache.cc b/game/cache.cc
index 69974e2..0f1edd0 100644
--- a/game/cache.cc
+++ b/game/cache.cc
@@ -9,7 +9,11 @@ namespace cache {
 	fs::path constructSVGCacheFileName(fs::path const& svgfilename, double factor){
 		fs::path cache_filename;
 		std::string const lod = (boost::format("%.2f") % factor).str();
+#if BOOST_FILESYSTEM_VERSION < 3
 		std::string const cache_basename = svgfilename.filename() + ".cache_" + lod + ".png";
+#else
+		std::string const cache_basename = svgfilename.filename().string() + ".cache_" + lod + ".png";
+#endif
 
 		if (isThemeResource(svgfilename)) {
 			std::string const theme_name = (config["game/theme"].s().empty() ? "default" : config["game/theme"].s());
diff --git a/game/filemagic.hh b/game/filemagic.hh
index bf87ded..29e81fe 100644
--- a/game/filemagic.hh
+++ b/game/filemagic.hh
@@ -71,7 +71,11 @@ namespace filemagic {
 		// For now, just check the extension an assume it's not lying.
 
 		// Get file extension in lower case
+#if BOOST_FILESYSTEM_VERSION < 3
 		std::string ext = filename.extension();
+#else
+		std::string ext = filename.extension().string();
+#endif
 		// somehow this does not convert the extension to lower case:
 		//std::for_each(ext.begin(), ext.end(), static_cast<int(*)(int)>(std::tolower));
 		std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower );
diff --git a/game/fs.cc b/game/fs.cc
index e34a784..767a7ab 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -128,7 +128,11 @@ std::string getThemePath(std::string const& filename) {
 
 bool isThemeResource(fs::path filename){
 	try {
+#if BOOST_FILESYSTEM_VERSION < 3
 		std::string themefile = getThemePath(filename.filename());
+#else
+		std::string themefile = getThemePath(filename.filename().string());
+#endif
 		return themefile == filename;
 	} catch (...) { return false; }
 }
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 38e163b..db15d79 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -104,7 +104,11 @@ void SongParser::iniParseHeader() {
 	// Search the dir for the music files
 	for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
 		boost::filesystem::path p = dirIt->path();
+#if BOOST_FILESYSTEM_VERSION < 3
 		std::string name = p.leaf(); // File basename (notes.txt)
+#else
+		std::string name = p.filename().string(); // File basename (notes.txt)
+#endif
 		if (regex_match(name.c_str(), match, midifile)) {
 			 s.midifilename = name;
 		} else if (regex_match(name.c_str(), match, audiofile_background)) {
diff --git a/game/songparser.cc b/game/songparser.cc
index 2b7b9b4..ac9f3f6 100644
--- a/game/songparser.cc
+++ b/game/songparser.cc
@@ -100,7 +100,11 @@ SongParser::SongParser(Song& s):
 
 		for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
 			boost::filesystem::path p = dirIt->path();
+#if BOOST_FILESYSTEM_VERSION < 3
 			std::string name = p.leaf(); // File basename
+#else
+			std::string name = p.filename().string(); // File basename
+#endif
 			if (m_song.cover.empty() && regex_match(name.c_str(), match, coverfile)) {
 				m_song.cover = name;
 			} else if (m_song.background.empty() && regex_match(name.c_str(), match, backgroundfile)) {
diff --git a/game/songs.cc b/game/songs.cc
index 62ab26d..afab383 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -67,8 +67,13 @@ void Songs::reload_internal(fs::path const& parent) {
 		for (fs::directory_iterator dirIt(parent), dirEnd; m_loading && dirIt != dirEnd; ++dirIt) {
 			fs::path p = dirIt->path();
 			if (fs::is_directory(p)) { reload_internal(p); continue; }
+#if BOOST_FILESYSTEM_VERSION < 3
 			std::string name = p.leaf(); // File basename (notes.txt)
 			std::string path = p.directory_string(); // Path without filename
+#else
+			std::string name = p.filename().string(); // File basename (notes.txt)
+			std::string path = p.string(); // Path without filename
+#endif
 			path.erase(path.size() - name.size());
 			if (!regex_match(name.c_str(), match, expression)) continue;
 			try {
diff --git a/tools/ss_helpers.hh b/tools/ss_helpers.hh
index 58e19dc..8895d94 100644
--- a/tools/ss_helpers.hh
+++ b/tools/ss_helpers.hh
@@ -10,7 +10,11 @@ extern "C" void xmlLogger(void* logger, char const* msg, ...) { if (logger) *(st
 void enableXMLLogger(std::ostream& os = std::cerr) { xmlSetGenericErrorFunc(&os, xmlLogger); }
 void disableXMLLogger() { xmlSetGenericErrorFunc(NULL, xmlLogger); }
 
+#if BOOST_FILESYSTEM_VERSION < 3
 std::string filename(boost::filesystem::path const& p) { return *--p.end(); }
+#else
+std::string filename(boost::filesystem::path const& p) { return p.filename().string(); }
+#endif
 
 /** Fix Singstar's b0rked XML **/
 std::string xmlFix(std::vector<char> const& data) {
-- 
1.7.4.1