Skip to content

Commit 7f54fbb

Browse files
authored
Merge pull request #1467 from murraystevenson/boost182compatibility
Boost 1.82 Compatibility
2 parents ee32580 + bf4bd5b commit 7f54fbb

File tree

9 files changed

+20
-19
lines changed

9 files changed

+20
-19
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
10.5.x.x (relative to 10.5.14.0)
22
========
33

4+
Fixes
5+
-----
46

7+
- Boost : Fixed compatibility with Boost 1.82.
58

69
10.5.14.0 (relative to 10.5.13.1)
710
=========

src/IECore/FileNameParameter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ bool FileNameParameter::valueValid( const Object *value, std::string *reason ) c
8787
// extensions check
8888
if( extensions().size() )
8989
{
90-
string ext = boost::filesystem::extension(boost::filesystem::path( s->readable()));
90+
string ext = boost::filesystem::path( s->readable() ).extension().string();
9191

9292
const vector<string> &exts = extensions();
9393
bool found = false;

src/IECore/FileSequenceParameter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#include "boost/algorithm/string/classification.hpp"
4343
#include "boost/algorithm/string/split.hpp"
44-
#include "boost/filesystem/convenience.hpp"
44+
#include "boost/filesystem/path.hpp"
4545

4646
#include <algorithm>
4747
#include <cassert>
@@ -130,7 +130,7 @@ bool FileSequenceParameter::valueValid( const Object *value, std::string *reason
130130

131131
if ( m_extensions.size() )
132132
{
133-
std::string ext = boost::filesystem::extension( boost::filesystem::path( fileSequence->getFileName() ) );
133+
std::string ext = boost::filesystem::path( fileSequence->getFileName() ).extension().string();
134134
if ( ext.size() && ext[0] == '.' )
135135
{
136136
ext = ext.substr( 1, ext.size() - 1 );

src/IECore/FileSequenceVectorParameter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#include "boost/algorithm/string/classification.hpp"
4343
#include "boost/algorithm/string/split.hpp"
44-
#include "boost/filesystem/convenience.hpp"
44+
#include "boost/filesystem/path.hpp"
4545

4646
#include <algorithm>
4747
#include <cassert>
@@ -131,7 +131,7 @@ bool FileSequenceVectorParameter::valueValid( const Object *value, std::string *
131131

132132
if ( m_extensions.size() )
133133
{
134-
std::string ext = boost::filesystem::extension( boost::filesystem::path( fileSequence->getFileName() ) );
134+
std::string ext = boost::filesystem::path( fileSequence->getFileName() ).extension().string();
135135
if ( ext.size() && ext[0] == '.' )
136136
{
137137
ext = ext.substr( 1, ext.size() - 1 );
@@ -257,7 +257,7 @@ FileSequencePtr FileSequenceVectorParameter::parseFileSequence( const std::strin
257257
frameList = FrameList::parse( tail );
258258
found = true;
259259
}
260-
260+
261261
catch ( Exception & )
262262
{
263263
fileSequenceCopy = fileSequenceCopy.substr( 0, spaceIndex )
@@ -267,7 +267,7 @@ FileSequencePtr FileSequenceVectorParameter::parseFileSequence( const std::strin
267267

268268
spaceIndex = fileSequenceCopy.find_first_of( " " );
269269
}
270-
270+
271271
}
272272

273273
return new FileSequence( filename, frameList );

src/IECore/IndexedIO.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#include "IECore/Exception.h"
3838

39-
#include "boost/filesystem/convenience.hpp"
39+
#include "boost/filesystem/path.hpp"
4040
#include "boost/algorithm/string.hpp"
4141

4242
#include <iostream>
@@ -67,16 +67,14 @@ static CreatorMap &creators()
6767

6868
IE_CORE_DEFINERUNTIMETYPEDDESCRIPTION( IndexedIO )
6969

70-
namespace fs = boost::filesystem;
71-
7270
const IndexedIO::EntryID IndexedIO::rootName("/");
7371
const IndexedIO::EntryIDList IndexedIO::rootPath;
7472

7573
IndexedIOPtr IndexedIO::create( const std::string &path, const IndexedIO::EntryIDList &root, IndexedIO::OpenMode mode, const CompoundData *options )
7674
{
7775
IndexedIOPtr result = nullptr;
7876

79-
std::string extension = fs::extension(path);
77+
std::string extension = boost::filesystem::path( path ).extension().string();
8078
boost::to_lower( extension );
8179

8280
const CreatorMap &createFns = creators();

src/IECore/Reader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#include "boost/algorithm/string/classification.hpp"
4242
#include "boost/algorithm/string/split.hpp"
43-
#include "boost/filesystem/convenience.hpp"
43+
#include "boost/filesystem/path.hpp"
4444

4545
using namespace std;
4646
using namespace IECore;
@@ -84,7 +84,7 @@ ReaderPtr Reader::create( const std::string &fileName )
8484
bool knownExtension = false;
8585
ExtensionsToFnsMap *m = extensionsToFns();
8686
assert( m );
87-
string ext = extension(boost::filesystem::path(fileName));
87+
string ext = boost::filesystem::path( fileName ).extension().string();
8888
if( ext!="" )
8989
{
9090
ExtensionsToFnsMap::const_iterator it = m->find( ext );

src/IECore/SearchPath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ std::string SearchPath::getPaths( const std::string &separator ) const
106106
boost::filesystem::path SearchPath::find( const boost::filesystem::path &file ) const
107107
{
108108
// if it's a full path then there's no need to do any searching
109-
if( file.is_complete() )
109+
if( file.is_absolute() )
110110
{
111111
if( exists( file ) )
112112
{

src/IECore/Writer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#include "boost/algorithm/string/classification.hpp"
4343
#include "boost/algorithm/string/split.hpp"
44-
#include "boost/filesystem/convenience.hpp"
44+
#include "boost/filesystem/path.hpp"
4545

4646
#include <cassert>
4747

@@ -116,7 +116,7 @@ void Writer::registerWriter( const std::string &extensions, CanWriteFn canWrite,
116116

117117
WriterPtr Writer::create( ObjectPtr object, const std::string &fileName )
118118
{
119-
string ext = extension(boost::filesystem::path(fileName));
119+
string ext = boost::filesystem::path( fileName ).extension().string();
120120

121121
ExtensionsToFnsMap *m = extensionsToFns();
122122
assert( m );
@@ -146,7 +146,7 @@ WriterPtr Writer::create( ObjectPtr object, const std::string &fileName )
146146

147147
WriterPtr Writer::create( const std::string &fileName )
148148
{
149-
string ext = extension(boost::filesystem::path(fileName));
149+
string ext = boost::filesystem::path( fileName ).extension().string();
150150

151151
ExtensionsToFnsMap *m = extensionsToFns();
152152
ExtensionsToFnsMap::const_iterator it = m->find( ext );

src/IECoreScene/SceneInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "IECoreScene/SceneInterface.h"
3636

37-
#include "boost/filesystem/convenience.hpp"
37+
#include "boost/filesystem/path.hpp"
3838
#include "boost/tokenizer.hpp"
3939
#include "boost/algorithm/string.hpp"
4040

@@ -104,7 +104,7 @@ SceneInterfacePtr SceneInterface::create( const std::string &path, IndexedIO::Op
104104
{
105105
SceneInterfacePtr result = nullptr;
106106

107-
std::string extension = boost::filesystem::extension(path);
107+
std::string extension = boost::filesystem::path( path ).extension().string();
108108
boost::algorithm::to_lower( extension );
109109
IndexedIO::OpenModeFlags openMode = IndexedIO::OpenModeFlags( mode & (IndexedIO::Read|IndexedIO::Write|IndexedIO::Append) );
110110
std::pair< std::string, IndexedIO::OpenModeFlags > key( extension, openMode );

0 commit comments

Comments
 (0)