Commit e8991c64 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX #129] switched completely to filesystem 3.

parent ca5a285d
......@@ -26,10 +26,6 @@
#include <streambuf>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "exceptions/WFileNotFound.h"
......@@ -43,11 +39,11 @@ std::string readFileIntoString( const std::string& name )
std::string readFileIntoString( const boost::filesystem::path& path )
{
std::string filename = path.file_string();
std::string filename = path.string();
std::ifstream input( filename.c_str() );
if( !input.is_open() )
{
throw WFileNotFound( std::string( "The file \"" ) + boost::filesystem::complete( path ).file_string() + std::string( "\" does not exist." ) );
throw WFileNotFound( std::string( "The file \"" ) + path.string() + std::string( "\" does not exist." ) );
}
// preallocate space for the string.
......@@ -69,10 +65,10 @@ void writeStringIntoFile( const std::string& name, const std::string& content )
void writeStringIntoFile( const boost::filesystem::path& path, const std::string& content )
{
std::ofstream outfile( path.file_string().c_str() );
std::ofstream outfile( path.string().c_str() );
if( !outfile.is_open() )
{
throw WFileOpenFailed( "The file \"" + boost::filesystem::complete( path ).file_string() + "\" could not be opened." );
throw WFileOpenFailed( "The file \"" + path.string() + "\" could not be opened." );
}
outfile << content << std::flush;
......
......@@ -30,10 +30,6 @@
#include <algorithm>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "WExportCommon.h"
......@@ -92,13 +88,22 @@ template< class T > void switchByteOrderOfArray( T *array, const size_t arraySiz
}
}
/**
* \param name File name to get the extension or suffix from.
* \return filename suffix
*/
inline std::string getSuffix( boost::filesystem::path name )
{
return name.extension().string();
}
/**
* \param name File name to get the extension or suffix from.
* \return filename suffix
*/
inline std::string getSuffix( std::string name )
{
return boost::filesystem::path( name ).extension();
return getSuffix( boost::filesystem::path( name ) );
}
/**
......
......@@ -27,10 +27,6 @@
#include <vector>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
......
......@@ -25,10 +25,6 @@
#include <list>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "exceptions/WPropertyNameMalformed.h"
......
......@@ -32,10 +32,6 @@
#include <vector>
#include <utility>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
......
......@@ -31,10 +31,6 @@
#include <windows.h> // NOLINT
#endif
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "exceptions/WLibraryFetchFailed.h"
......@@ -243,7 +239,7 @@ struct WSharedLib::data
#endif
WSharedLib::WSharedLib( boost::filesystem::path lib ):
m_data( new data( lib.native_file_string() ) )
m_data( new data( lib.string() ) )
{
}
......
......@@ -28,10 +28,6 @@
#include <algorithm>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "WExportCommon.h"
......
......@@ -105,7 +105,7 @@ public:
boost::filesystem::path fpath = tempFileName();
writeStringIntoFile( fpath, content );
std::ifstream input( fpath.file_string().c_str() );
std::ifstream input( fpath.string().c_str() );
std::string actual;
actual.assign( ( std::istreambuf_iterator< char >( input ) ), std::istreambuf_iterator< char >() );
input.close();
......
......@@ -28,10 +28,6 @@
#include <utility>
#include <vector>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem/fstream.hpp>
#include <boost/lexical_cast.hpp>
......
......@@ -24,10 +24,6 @@
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include "../../common/WIOTools.h"
......
......@@ -25,10 +25,6 @@
#include <fstream>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
......@@ -39,7 +35,7 @@
#include "WWriterDendrogram.h"
WWriterDendrogram::WWriterDendrogram( const boost::filesystem::path& path, bool overwrite )
: WWriter( path.file_string(), overwrite )
: WWriter( path.string(), overwrite )
{
}
......
......@@ -27,10 +27,6 @@
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
......
......@@ -25,10 +25,6 @@
#include <fstream>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
......@@ -39,7 +35,7 @@
#include "WWriterFiberVTK.h"
WWriterFiberVTK::WWriterFiberVTK( const boost::filesystem::path& path, bool overwrite )
: WWriter( path.file_string(), overwrite )
: WWriter( path.string(), overwrite )
{
}
void WWriterFiberVTK::writeFibs( boost::shared_ptr< const WDataSetFibers > fiberDS ) const
......
......@@ -27,10 +27,6 @@
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
......
......@@ -388,7 +388,7 @@ osg::ref_ptr< osg::PositionAttitudeTransform > wge::addLabel( osg::Vec3 position
labelGeode->addDrawable( label );
// setup font
label->setFont( WPathHelper::getAllFonts().Default.file_string() );
label->setFont( WPathHelper::getAllFonts().Default.string() );
label->setBackdropType( osgText::Text::OUTLINE );
label->setCharacterSize( 6 );
......
......@@ -261,7 +261,7 @@ WGETextureHud::WGETextureHudEntry::WGETextureHudEntry( osg::ref_ptr< osg::Textur
state->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
addChild( textGeode );
osgText::Text* label = new osgText::Text();
label->setFont( WPathHelper::getAllFonts().Default.file_string() );
label->setFont( WPathHelper::getAllFonts().Default.string() );
label->setBackdropType( osgText::Text::OUTLINE );
label->setCharacterSize( 15 );
label->setText( m_name );
......
......@@ -29,10 +29,6 @@
#include <fstream>
#include <boost/algorithm/string.hpp>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/function.hpp>
#include <boost/lexical_cast.hpp>
......@@ -242,9 +238,9 @@ std::string WGEShader::processShaderRecursive( const std::string filename, bool
// use one of the following paths
std::string fn = filename;
std::string fnLocal = ( m_shaderPath / filename ).file_string();
std::string fnLocalShaders = ( m_shaderPath / "shaders" / filename ).file_string();
std::string fnGlobal = ( WPathHelper::getShaderPath() / filename ).file_string();
std::string fnLocal = ( m_shaderPath / filename ).string();
std::string fnLocalShaders = ( m_shaderPath / "shaders" / filename ).string();
std::string fnGlobal = ( WPathHelper::getShaderPath() / filename ).string();
if( boost::filesystem::exists( m_shaderPath / filename ) )
{
......@@ -261,8 +257,8 @@ std::string WGEShader::processShaderRecursive( const std::string filename, bool
else if( !optional )
{
WLogger::getLogger()->addLogMessage( "The requested shader \"" + filename + "\" does not exist in \"" +
m_shaderPath.file_string() + "\", \"" + ( m_shaderPath / "shaders" ).file_string() + "\" or \"" +
WPathHelper::getShaderPath().file_string() + "\".", "WGEShader (" + filename + ")", LL_ERROR
m_shaderPath.string() + "\", \"" + ( m_shaderPath / "shaders" ).string() + "\" or \"" +
WPathHelper::getShaderPath().string() + "\".", "WGEShader (" + filename + ")", LL_ERROR
);
return "";
......
......@@ -28,10 +28,6 @@
#include <map>
#include <string>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include <boost/filesystem.hpp>
#include <boost/signals2/signal.hpp>
......
......@@ -33,7 +33,7 @@ WGELabel::WGELabel():
{
// initialize members
setCharacterSize( 21 );
setFont( WPathHelper::getAllFonts().Default.file_string() );
setFont( WPathHelper::getAllFonts().Default.string() );
setAxisAlignment( osgText::Text::SCREEN );
setAlignment( osgText::Text::LEFT_BOTTOM );
setBackdropType( osgText::Text::OUTLINE );
......
......@@ -33,11 +33,6 @@
#include <string>
#include <vector>
// Use filesystem version 2 for compatibility with newer boost versions.
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 2
#endif
#include "../common/WThreadedRunner.h"
#include "../common/WTimer.h"
#include "../common/WRealtimeTimer.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment