Skip to content

Commit 80d3f40

Browse files
committed
cortex: support for newer boost
1 parent 0b88aa4 commit 80d3f40

16 files changed

+44
-42
lines changed

include/IECorePython/VectorTypedDataBinding.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define IECOREPYTHON_VECTORTYPEDDATABINDING_INL
3737

3838
#include "boost/python.hpp"
39+
#include "boost/numeric/conversion/cast.hpp"
3940

4041
#include "IECorePython/IECoreBinding.h"
4142
#include "IECorePython/RunTimeTypedBinding.h"

src/IECore/DirNameParameter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#include "boost/algorithm/string/classification.hpp"
4040
#include "boost/algorithm/string/split.hpp"
41-
#include "boost/filesystem/convenience.hpp"
41+
#include "boost/filesystem/path.hpp"
4242
#include "boost/filesystem/operations.hpp"
4343

4444
#include <algorithm>

src/IECore/FileNameParameter.cpp

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

4040
#include "boost/algorithm/string/classification.hpp"
4141
#include "boost/algorithm/string/split.hpp"
42-
#include "boost/filesystem/convenience.hpp"
42+
#include "boost/filesystem/path.hpp"
4343
#include "boost/filesystem/operations.hpp"
4444
#include "boost/format.hpp"
4545

@@ -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(boost::filesystem::path( s->readable())).extension().string();
9191

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

src/IECore/FileSequenceFunctions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#include "IECore/ReversedFrameList.h"
4343

4444
#include "boost/algorithm/string.hpp"
45-
#include "boost/filesystem/convenience.hpp"
46-
#include "boost/filesystem/operations.hpp"
4745
#include "boost/filesystem/path.hpp"
46+
#include "boost/filesystem/operations.hpp"
47+
#include "boost/filesystem/directory.hpp"
4848
#include "boost/format.hpp"
4949
#include "boost/lexical_cast.hpp"
5050
#include "boost/regex.hpp"

src/IECore/FileSequenceParameter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
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"
45+
#include "boost/filesystem/operations.hpp"
4546

4647
#include <algorithm>
4748
#include <cassert>
@@ -130,7 +131,7 @@ bool FileSequenceParameter::valueValid( const Object *value, std::string *reason
130131

131132
if ( m_extensions.size() )
132133
{
133-
std::string ext = boost::filesystem::extension( boost::filesystem::path( fileSequence->getFileName() ) );
134+
std::string ext = boost::filesystem::path( boost::filesystem::path( fileSequence->getFileName() ) ).extension().string();
134135
if ( ext.size() && ext[0] == '.' )
135136
{
136137
ext = ext.substr( 1, ext.size() - 1 );

src/IECore/FileSequenceVectorParameter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
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/operations.hpp"
45+
#include "boost/filesystem/path.hpp"
4546

4647
#include <algorithm>
4748
#include <cassert>
@@ -131,7 +132,7 @@ bool FileSequenceVectorParameter::valueValid( const Object *value, std::string *
131132

132133
if ( m_extensions.size() )
133134
{
134-
std::string ext = boost::filesystem::extension( boost::filesystem::path( fileSequence->getFileName() ) );
135+
std::string ext = boost::filesystem::path( boost::filesystem::path( fileSequence->getFileName())).extension().string();
135136
if ( ext.size() && ext[0] == '.' )
136137
{
137138
ext = ext.substr( 1, ext.size() - 1 );

src/IECore/IndexedIO.cpp

Lines changed: 2 additions & 2 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>
@@ -76,7 +76,7 @@ IndexedIOPtr IndexedIO::create( const std::string &path, const IndexedIO::EntryI
7676
{
7777
IndexedIOPtr result = nullptr;
7878

79-
std::string extension = fs::extension(path);
79+
std::string extension = fs::path(path).extension().string();
8080
boost::to_lower( extension );
8181

8282
const CreatorMap &createFns = creators();

src/IECore/PathParameter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#include "boost/algorithm/string/classification.hpp"
4040
#include "boost/algorithm/string/split.hpp"
41-
#include "boost/filesystem/convenience.hpp"
41+
#include "boost/filesystem/path.hpp"
4242
#include "boost/filesystem/operations.hpp"
4343

4444
#include <algorithm>

src/IECore/PathVectorParameter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#include "boost/algorithm/string/classification.hpp"
4040
#include "boost/algorithm/string/split.hpp"
41-
#include "boost/filesystem/convenience.hpp"
41+
#include "boost/filesystem/path.hpp"
4242
#include "boost/filesystem/operations.hpp"
4343

4444
#include <algorithm>

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 = path(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 = path(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 = path(boost::filesystem::path(fileName)).extension().string();
150150

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

src/IECoreGL/Selector.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#include "IECore/MessageHandler.h"
5454

5555
#include "boost/format.hpp"
56-
#include "boost/timer.hpp"
5756

5857
using namespace IECoreGL;
5958

src/IECoreImage/ClientDisplayDriver.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ClientDisplayDriver::PrivateData : public RefCounted
7373
m_socket.close();
7474
}
7575

76-
boost::asio::io_service m_service;
76+
boost::asio::io_context m_service;
7777
std::string m_host;
7878
std::string m_port;
7979
bool m_scanLineOrderOnly;
@@ -96,23 +96,23 @@ ClientDisplayDriver::ClientDisplayDriver( const Imath::Box2i &displayWindow, con
9696
m_data->m_host = displayHostData->readable();
9797
m_data->m_port = displayPortData->readable();
9898

99-
tcp::resolver resolver(m_data->m_service);
100-
tcp::resolver::query query(m_data->m_host, m_data->m_port);
101-
102-
boost::system::error_code error;
103-
tcp::resolver::iterator iterator = resolver.resolve( query, error );
104-
if( !error )
105-
{
99+
boost::asio::io_context io_context;
100+
tcp::resolver resolver(io_context);
101+
boost::system::error_code error;
102+
auto endpoints = resolver.resolve(m_data->m_host, m_data->m_port, error);
103+
if (!error)
104+
{
106105
error = boost::asio::error::host_not_found;
107-
while( error && iterator != tcp::resolver::iterator() )
108-
{
109-
m_data->m_socket.close();
110-
m_data->m_socket.connect( *iterator++, error );
111-
}
112-
}
113-
if( error )
114-
{
115-
throw Exception( std::string( "Could not connect to remote display driver server : " ) + error.message() );
106+
for (auto it = endpoints.begin(); it != endpoints.end() && error; ++it)
107+
{
108+
m_data->m_socket.close();
109+
m_data->m_socket.connect(*it, error);
110+
}
111+
112+
if (error)
113+
{
114+
throw Exception( std::string( "Could not connect to remote display driver server : " ) + error.message() );
115+
}
116116
}
117117

118118
MemoryIndexedIOPtr io;

src/IECoreImage/DisplayDriverServer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class DisplayDriverServer::Session : public RefCounted
106106
{
107107
public:
108108

109-
Session( boost::asio::io_service& io_service, MergeMap& mergeMap );
109+
Session( boost::asio::io_context& io_service, MergeMap& mergeMap );
110110
~Session() override;
111111

112112
boost::asio::ip::tcp::socket& socket();
@@ -135,7 +135,7 @@ class DisplayDriverServer::PrivateData : public RefCounted
135135
public :
136136

137137
boost::asio::ip::tcp::endpoint m_endpoint;
138-
boost::asio::io_service m_service;
138+
boost::asio::io_context m_service;
139139
boost::asio::ip::tcp::acceptor m_acceptor;
140140
std::thread m_thread;
141141
MergeMap m_mergeMap;
@@ -306,7 +306,7 @@ void DisplayDriverServer::handleAccept( DisplayDriverServer::SessionPtr session,
306306
* DisplayDriverServer::Session functions
307307
*/
308308

309-
DisplayDriverServer::Session::Session( boost::asio::io_service& io_service, MergeMap& mergeMap ) :
309+
DisplayDriverServer::Session::Session( boost::asio::io_context& io_service, MergeMap& mergeMap ) :
310310
m_socket( io_service ), m_displayDriver(nullptr), m_buffer( new CharVectorData( ) ), m_mergeMap( mergeMap )
311311
{
312312
}

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)