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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
diff -up bear-engine/CMakeLists.txt.boost146 bear-engine/CMakeLists.txt
--- bear-engine/CMakeLists.txt.boost146 2012-08-21 15:33:24.606557059 -0500
+++ bear-engine/CMakeLists.txt 2012-08-21 15:33:24.610557060 -0500
@@ -56,7 +56,7 @@ if( NOT Boost_FOUND )
message( FATAL_ERROR
"You must have boost::filesystem, boost::signals, boost::thread and boost::regex libraries installed (at least 1.35)" )
endif( NOT Boost_FOUND )
-add_definitions(-D BOOST_FILESYSTEM_VERSION=2)
+add_definitions(-D BOOST_FILESYSTEM_VERSION=3)
#-------------------------------------------------------------------------------
# Include directories for Boost
diff -up bear-engine/core/src/engine/code/game_local_client.cpp.boost146 bear-engine/core/src/engine/code/game_local_client.cpp
--- bear-engine/core/src/engine/code/game_local_client.cpp.boost146 2011-08-24 16:57:00.000000000 -0500
+++ bear-engine/core/src/engine/code/game_local_client.cpp 2012-08-21 15:33:24.610557060 -0500
@@ -368,7 +368,11 @@ std::string bear::engine::game_local_cli
if ( !result.empty() )
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path( result, boost::filesystem::native );
+#else
+ boost::filesystem::path path( result );
+#endif
path /= name;
result = path.string();
}
@@ -623,13 +627,22 @@ std::string bear::engine::game_local_cli
*/
std::string bear::engine::game_local_client::get_game_directory() const
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path dir
(claw::system_info::get_user_directory(), boost::filesystem::native);
+#else
+ boost::filesystem::path dir
+ (claw::system_info::get_user_directory());
+#endif
std::string result;
std::string subdir = '.' + get_game_name_as_filename();
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
dir /= boost::filesystem::path(subdir, boost::filesystem::native);
+#else
+ dir /= boost::filesystem::path(subdir);
+#endif
if ( create_game_directory(dir.string()) )
result = dir.string();
@@ -649,7 +662,11 @@ bool bear::engine::game_local_client::cr
( const std::string& dir ) const
{
bool result = false;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path( dir, boost::filesystem::native );
+#else
+ boost::filesystem::path path( dir );
+#endif
if ( boost::filesystem::exists( path ) )
result = boost::filesystem::is_directory( path );
diff -up bear-engine/core/src/engine/code/resource_pool.cpp.boost146 bear-engine/core/src/engine/code/resource_pool.cpp
--- bear-engine/core/src/engine/code/resource_pool.cpp.boost146 2011-07-17 14:01:25.000000000 -0500
+++ bear-engine/core/src/engine/code/resource_pool.cpp 2012-08-21 15:33:24.611557060 -0500
@@ -137,7 +137,11 @@ bool bear::engine::resource_pool::find_f
const std::string filepath =
*it + boost::filesystem::slash<boost::filesystem::path>::value + name;
#endif
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
const boost::filesystem::path path( filepath, boost::filesystem::native );
+#else
+ const boost::filesystem::path path( filepath );
+#endif
if ( boost::filesystem::exists( path ) )
if ( !boost::filesystem::is_directory( path ) )
diff -up bear-factory/animation-editor/src/bf/code/configuration.cpp.boost146 bear-factory/animation-editor/src/bf/code/configuration.cpp
--- bear-factory/animation-editor/src/bf/code/configuration.cpp.boost146 2011-07-17 14:01:25.000000000 -0500
+++ bear-factory/animation-editor/src/bf/code/configuration.cpp 2012-08-21 15:33:24.611557060 -0500
@@ -116,10 +116,16 @@ bool bf::configuration::create_config_fi
{
bool result = false;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path
( path_configuration::get_instance().get_config_directory()
+ s_config_file_name,
boost::filesystem::native );
+#else
+ boost::filesystem::path path
+ ( path_configuration::get_instance().get_config_directory()
+ + s_config_file_name );
+#endif
if ( !boost::filesystem::exists( path ) )
{
diff -up bear-factory/bear-editor/src/bf/code/path_configuration.cpp.boost146 bear-factory/bear-editor/src/bf/code/path_configuration.cpp
--- bear-factory/bear-editor/src/bf/code/path_configuration.cpp.boost146 2011-07-17 14:01:25.000000000 -0500
+++ bear-factory/bear-editor/src/bf/code/path_configuration.cpp 2012-08-21 15:33:24.611557060 -0500
@@ -130,7 +130,11 @@ std::string bf::path_configuration::get_
*/
bool bf::path_configuration::get_full_path( std::string& p ) const
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path( p, boost::filesystem::native );
+#else
+ boost::filesystem::path path( p );
+#endif
bool result = boost::filesystem::exists( path );
std::list<std::string>::const_reverse_iterator it;
@@ -191,14 +195,22 @@ bf::path_configuration::expand_file_name
*/
bool bf::path_configuration::get_relative_path( std::string& p ) const
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path( p, boost::filesystem::native );
+#else
+ boost::filesystem::path path( p );
+#endif
bool result = false;
std::list<std::string>::const_reverse_iterator it;
for (it=data_path.rbegin(); !result && (it!=data_path.rend()); ++it)
{
bool stop(false);
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path data( *it, boost::filesystem::native );
+#else
+ boost::filesystem::path data( *it );
+#endif
boost::filesystem::path::iterator pit = path.begin();
boost::filesystem::path::iterator dit = data.begin();
@@ -214,13 +226,20 @@ bool bf::path_configuration::get_relativ
if ( dit == data.end() )
{
result = true;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
p = *pit;
+#else
+ p = pit->string();
+#endif
for ( ++pit; pit!=path.end(); ++pit )
#if BOOST_VERSION / 100 % 1000 < 34
- p += '/' + *pit;
-#else
+ p += '/' + pit->string();
+#elif BOOST_VERSION / 100 % 1000 < 44
p +=
boost::filesystem::slash<boost::filesystem::path>::value + *pit;
+#else
+ p +=
+ boost::filesystem::slash<boost::filesystem::path>::value + pit->string();
#endif
}
}
@@ -256,6 +275,15 @@ void bf::path_configuration::load()
data_path.push_back(*it);
}
}
+
+ if ( item_class_path.empty() )
+ {
+ item_class_path.push_back("/usr/share/bear-factory/item-description");
+ item_class_path.push_back("/usr/share/bear-factory/plee-the-bear/item-description");
+ }
+
+ if ( data_path.empty() )
+ data_path.push_back("/usr/share/games/plee-the-bear/");
} // path_configuration::load()
/*----------------------------------------------------------------------------*/
@@ -268,8 +296,12 @@ bool bf::path_configuration::create_conf
{
bool result = false;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path
( get_config_directory(), boost::filesystem::native );
+#else
+ boost::filesystem::path path ( get_config_directory() );
+#endif
if ( boost::filesystem::exists( path ) )
result = boost::filesystem::is_directory( path );
@@ -290,9 +322,13 @@ bool bf::path_configuration::create_conf
if ( create_config_directory() )
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path
( get_config_directory() + s_config_file_name,
boost::filesystem::native );
+#else
+ boost::filesystem::path path ( get_config_directory() + s_config_file_name );
+#endif
if ( !boost::filesystem::exists( path ) )
{
@@ -389,7 +425,11 @@ bool bf::path_configuration::find_random
for (it=data_path.begin(); (it!=data_path.end()) && (candidates.size() < m);
++it)
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
const boost::filesystem::path dirpath( *it, boost::filesystem::native );
+#else
+ const boost::filesystem::path dirpath( *it );
+#endif
if ( boost::filesystem::exists( dirpath ) )
if ( boost::filesystem::is_directory( dirpath ) )
@@ -436,13 +476,18 @@ void bf::path_configuration::find_all_fi
( const std::string& dirname, const std::string& pattern, std::size_t offset,
std::size_t m, std::list<std::string>& result ) const
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
const boost::filesystem::path path( dirname, boost::filesystem::native );
+#else
+ const boost::filesystem::path path( dirname );
+#endif
CLAW_PRECOND( boost::filesystem::is_directory(path) );
boost::filesystem::directory_iterator it(path);
const boost::filesystem::directory_iterator eit;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
for ( ; (it!=eit) && (result.size() < m); ++it )
if ( boost::filesystem::is_directory(*it) )
{
@@ -451,6 +496,16 @@ void bf::path_configuration::find_all_fi
}
else if ( glob_match(pattern, it->string(), offset) )
result.push_back(it->string());
+#else
+ for ( ; (it!=eit) && (result.size() < m); ++it )
+ if ( boost::filesystem::is_directory(*it) )
+ {
+ if ( glob_potential_match(pattern, it->path().string(), offset) )
+ find_all_files_in_dir(it->path().string(), pattern, offset, m, result);
+ }
+ else if ( glob_match(pattern, it->path().string(), offset) )
+ result.push_back(it->path().string());
+#endif
} // path_configuration::find_all_files_in_dir()
/*----------------------------------------------------------------------------*/
diff -up bear-factory/bear-editor/src/bf/impl/scan_dir.tpp.boost146 bear-factory/bear-editor/src/bf/impl/scan_dir.tpp
--- bear-factory/bear-editor/src/bf/impl/scan_dir.tpp.boost146 2011-07-17 14:01:25.000000000 -0500
+++ bear-factory/bear-editor/src/bf/impl/scan_dir.tpp 2012-08-21 15:33:24.611557060 -0500
@@ -46,7 +46,11 @@ void bf::scan_dir<Func>::operator()
( const std::string& dir, Func& f, Iterator first_ext, Iterator last_ext )
{
std::queue<boost::filesystem::path> pending;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path(dir, boost::filesystem::native);
+#else
+ boost::filesystem::path path(dir);
+#endif
if ( !boost::filesystem::exists(path) )
return;
@@ -64,8 +68,13 @@ void bf::scan_dir<Func>::operator()
for ( ; it!=eit; ++it)
if ( boost::filesystem::is_directory(*it) )
pending.push(*it);
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
else if (supported_extension( it->string(), first_ext, last_ext ))
f(it->string());
+#else
+ else if (supported_extension( it->path().string(), first_ext, last_ext ))
+ f(it->path().string());
+#endif
}
} // scan_dir::operator()
diff -up bear-factory/CMakeLists.txt.boost146 bear-factory/CMakeLists.txt
--- bear-factory/CMakeLists.txt.boost146 2011-03-22 15:31:21.000000000 -0500
+++ bear-factory/CMakeLists.txt 2012-08-21 15:33:24.611557060 -0500
@@ -59,7 +59,7 @@ if( NOT Boost_FOUND )
message( FATAL_ERROR
"You must have boost::system and boost::filesystem libraries installed (at least 1.35)" )
endif( NOT Boost_FOUND )
-add_definitions(-D BOOST_FILESYSTEM_VERSION=2)
+add_definitions(-D BOOST_FILESYSTEM_VERSION=3)
#-------------------------------------------------------------------------------
# Link directories for Boost
diff -up bear-factory/level-editor/src/bf/code/configuration.cpp.boost146 bear-factory/level-editor/src/bf/code/configuration.cpp
--- bear-factory/level-editor/src/bf/code/configuration.cpp.boost146 2011-07-17 14:01:25.000000000 -0500
+++ bear-factory/level-editor/src/bf/code/configuration.cpp 2012-08-21 15:33:24.611557060 -0500
@@ -151,10 +151,16 @@ bool bf::configuration::create_config_fi
{
bool result = false;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path
( path_configuration::get_instance().get_config_directory()
+ s_config_file_name,
boost::filesystem::native );
+#else
+ boost::filesystem::path path
+ ( path_configuration::get_instance().get_config_directory()
+ + s_config_file_name );
+#endif
if ( !boost::filesystem::exists( path ) )
{
diff -up bear-factory/model-editor/src/bf/code/configuration.cpp.boost146 bear-factory/model-editor/src/bf/code/configuration.cpp
--- bear-factory/model-editor/src/bf/code/configuration.cpp.boost146 2011-07-17 14:01:25.000000000 -0500
+++ bear-factory/model-editor/src/bf/code/configuration.cpp 2012-08-21 15:33:24.611557060 -0500
@@ -124,10 +124,16 @@ bool bf::configuration::create_config_fi
{
bool result = false;
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
boost::filesystem::path path
( path_configuration::get_instance().get_config_directory()
+ s_config_file_name,
boost::filesystem::native );
+#else
+ boost::filesystem::path path
+ ( path_configuration::get_instance().get_config_directory()
+ + s_config_file_name );
+#endif
if ( !boost::filesystem::exists( path ) )
{
diff -up plee-the-bear/CMakeLists.txt.boost146 plee-the-bear/CMakeLists.txt
--- plee-the-bear/CMakeLists.txt.boost146 2012-08-21 15:33:24.606557059 -0500
+++ plee-the-bear/CMakeLists.txt 2012-08-21 15:33:24.611557060 -0500
@@ -94,7 +94,7 @@ if( NOT Boost_FOUND )
message( FATAL_ERROR
"You must have boost::filesystem and boost::thread libraries installed (at least 1.35)" )
endif( NOT Boost_FOUND )
-add_definitions(-D BOOST_FILESYSTEM_VERSION=2)
+add_definitions(-D BOOST_FILESYSTEM_VERSION=3)
#-------------------------------------------------------------------------------
# Include directories for Boost
diff -up plee-the-bear/data/CMakeLists.txt.boost146 plee-the-bear/data/CMakeLists.txt
--- plee-the-bear/data/CMakeLists.txt.boost146 2010-11-21 08:24:51.000000000 -0600
+++ plee-the-bear/data/CMakeLists.txt 2012-08-21 15:33:24.611557060 -0500
@@ -25,6 +25,7 @@ install(
PATTERN "*.gz" EXCLUDE
PATTERN "*.bz2" EXCLUDE
PATTERN "README" EXCLUDE
+ PATTERN "AUTHORS" EXCLUDE
)
install(
diff -up plee-the-bear/src/ptb/frame/code/frame_profile_name.cpp.boost146 plee-the-bear/src/ptb/frame/code/frame_profile_name.cpp
--- plee-the-bear/src/ptb/frame/code/frame_profile_name.cpp.boost146 2012-08-21 15:44:43.707601717 -0500
+++ plee-the-bear/src/ptb/frame/code/frame_profile_name.cpp 2012-08-21 15:45:22.604604268 -0500
@@ -68,7 +68,11 @@ void ptb::frame_profile_name::validate()
{
boost::filesystem::path path
( bear::engine::game::get_instance().get_custom_game_file
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
(PTB_PROFILES_FOLDER) + name , boost::filesystem::native );
+#else
+ (PTB_PROFILES_FOLDER) + name );
+#endif
if ( !boost::filesystem::exists(path) )
{
diff -up plee-the-bear/src/ptb/frame/code/frame_profiles.cpp.boost146 plee-the-bear/src/ptb/frame/code/frame_profiles.cpp
--- plee-the-bear/src/ptb/frame/code/frame_profiles.cpp.boost146 2012-08-21 15:40:49.598586322 -0500
+++ plee-the-bear/src/ptb/frame/code/frame_profiles.cpp 2012-08-21 15:44:23.805600406 -0500
@@ -72,8 +72,13 @@ void ptb::frame_profiles::on_focus()
if ( m_msg_result & message_box::s_ok )
{
boost::filesystem::path path
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
( bear::engine::game::get_instance().get_custom_game_file
(PTB_PROFILES_FOLDER) + profile , boost::filesystem::native );
+#else
+ ( bear::engine::game::get_instance().get_custom_game_file
+ (PTB_PROFILES_FOLDER) + profile);
+#endif
if ( boost::filesystem::exists(path) )
{
@@ -283,7 +288,11 @@ void ptb::frame_profiles::update_control
unsigned int i = 0;
boost::filesystem::path path
( bear::engine::game::get_instance().get_custom_game_file
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
(PTB_PROFILES_FOLDER), boost::filesystem::native );
+#else
+ (PTB_PROFILES_FOLDER) );
+#endif
if ( !boost::filesystem::exists(path) )
boost::filesystem::create_directory( path );
@@ -297,7 +306,11 @@ void ptb::frame_profiles::update_control
if ( boost::filesystem::is_directory(*it) &&
(i < PTB_NUMBER_OF_PROFILES) )
{
+#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
std::string dir(it->string());
+#else
+ std::string dir(it->path().native());
+#endif
std::string name(dir, path.string().size(),
dir.size() - path.string().size());
|