64
64
65
65
#endif
66
66
67
+ #if BOOST_VERSION < 104400
68
+
69
+ // Boost 1.44.0 introduced Filesystem v3, which we use by defining BOOST_FILESYSTEM_VERSION=3 via
70
+ // the build process. Prior versions of boost didn't have this version, so we need this define
71
+ // to help write code suitable for both.
72
+
73
+ #define PATH_TO_STRING filename ()
74
+
75
+ #else
76
+
77
+ #define PATH_TO_STRING filename ().string()
78
+
79
+ #endif
80
+
67
81
using namespace IECore ;
68
82
69
83
void IECore::findSequences ( const std::vector< std::string > &names, std::vector< FileSequencePtr > &sequences, size_t minSequenceSize )
@@ -181,7 +195,7 @@ void IECore::ls( const std::string &path, std::vector< FileSequencePtr > &sequen
181
195
std::vector< std::string > files;
182
196
for ( boost::filesystem::directory_iterator it ( path ); it != end; ++it )
183
197
{
184
- files.push_back ( it->path ().filename (). string () );
198
+ files.push_back ( it->path ().PATH_TO_STRING );
185
199
}
186
200
187
201
findSequences ( files, sequences, minSequenceSize );
@@ -203,9 +217,9 @@ void IECore::ls( const std::string &sequencePath, FileSequencePtr &sequence, siz
203
217
204
218
std::vector< std::string > files;
205
219
206
- boost::filesystem::path dir = boost::filesystem::path ( sequencePath ).branch_path ();
220
+ boost::filesystem::path dir = boost::filesystem::path ( sequencePath ).parent_path ();
207
221
208
- std::string baseSequencePath = boost::filesystem::path ( sequencePath ).filename (). string () ;
222
+ std::string baseSequencePath = boost::filesystem::path ( sequencePath ).PATH_TO_STRING ;
209
223
210
224
const std::string::size_type first = baseSequencePath.find_first_of ( ' #' );
211
225
assert ( first != std::string::npos );
@@ -225,7 +239,7 @@ void IECore::ls( const std::string &sequencePath, FileSequencePtr &sequence, siz
225
239
226
240
for ( boost::filesystem::directory_iterator it ( dirToCheck ); it != end; ++it )
227
241
{
228
- const std::string fileName = it->path ().filename (). string () ;
242
+ const std::string fileName = it->path ().PATH_TO_STRING ;
229
243
230
244
if ( fileName.size () >= std::min ( prefix.size (), suffix.size () ) && fileName.substr ( 0 , prefix.size () ) == prefix && fileName.substr ( fileName.size () - suffix.size (), suffix.size () ) == suffix )
231
245
{
0 commit comments