Commit 141895b4 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX] - made many thrown exception constructions explicit.

parent c140477e
......@@ -82,7 +82,7 @@ WItemSelector WItemSelection::getSelector( size_t item )
if ( r->get().size() <= item )
{
throw WOutOfBounds( "The specified item does not exist." );
throw WOutOfBounds( std::string( "The specified item does not exist." ) );
}
l.push_back( item );
return WItemSelector( shared_from_this(), l );
......
......@@ -125,11 +125,11 @@ void WProperties::addProperty( boost::shared_ptr< WPropertyBase > prop )
// oh oh, this property name is not unique in this group
if ( !getName().empty() )
{
throw WPropertyNotUnique( "Property \"" + prop->getName() + "\" is not unique in this group (\"" + getName() + "\")." );
throw WPropertyNotUnique( std::string( "Property \"" + prop->getName() + "\" is not unique in this group (\"" + getName() + "\")." ) );
}
else
{
throw WPropertyNotUnique( "Property \"" + prop->getName() + "\" is not unique in this group (unnamed root)." );
throw WPropertyNotUnique( std::string( "Property \"" + prop->getName() + "\" is not unique in this group (unnamed root)." ) );
}
}
......@@ -222,7 +222,7 @@ boost::shared_ptr< WPropertyBase > WProperties::getProperty( std::string name )
boost::shared_ptr< WPropertyBase > p = findProperty( name );
if ( p == boost::shared_ptr< WPropertyBase >() )
{
throw WPropertyUnknown( "Property \"" + name + "\" can't be found." );
throw WPropertyUnknown( std::string( "Property \"" + name + "\" can't be found." ) );
}
return p;
......
......@@ -45,8 +45,8 @@ WPropertyBase::WPropertyBase( std::string name, std::string description ):
// check name validity
if ( ( m_name.find( std::string( "/" ) ) != std::string::npos ) || m_name.empty() )
{
throw WPropertyNameMalformed( "Property name \"" + name +
"\" is malformed. Do not use slashes (\"/\") or empty strings in property names." );
throw WPropertyNameMalformed( std::string( "Property name \"" + name +
"\" is malformed. Do not use slashes (\"/\") or empty strings in property names." ) );
}
}
......
......@@ -66,7 +66,7 @@ struct WSharedLib::data
{
if ( !m_hDLL )
{
throw WLibraryLoadFailed( "Could not load library \"" + m_path + "\" due to the error: " + errmsg() );
throw WLibraryLoadFailed( std::string( "Could not load library \"" + m_path + "\" due to the error: " + errmsg() ) );
}
}
......@@ -92,7 +92,7 @@ struct WSharedLib::data
func_ptr_type func_ptr = reinterpret_cast< func_ptr_type >( GetProcAddress( m_hDLL, name.c_str() ) );
if ( !func_ptr )
{
throw WLibraryFetchFailed( "Could not fetch symbol \"" + name + "\"" + " due to the error: " + errmsg() );
throw WLibraryFetchFailed( std::string( "Could not fetch symbol \"" + name + "\"" + " due to the error: " + errmsg() ) );
}
return func_ptr;
}
......@@ -188,7 +188,7 @@ struct WSharedLib::data
m_dl = dlopen( m_path.c_str(), RTLD_LAZY );
if ( !m_dl )
{
throw WLibraryLoadFailed( "Could not load library \"" + m_path + "\" due to the error: " + dlerror() );
throw WLibraryLoadFailed( std::string( "Could not load library \"" + m_path + "\" due to the error: " + dlerror() ) );
}
}
......@@ -224,7 +224,7 @@ struct WSharedLib::data
const char *err = dlerror();
if ( err )
{
throw WLibraryFetchFailed( "Could not fetch symbol \"" + name + "\"" + " due to the error: " + err );
throw WLibraryFetchFailed( std::string( "Could not fetch symbol \"" + name + "\"" + " due to the error: " + err ) );
}
return variable_ptr;
}
......
......@@ -45,7 +45,7 @@ size_t WUnionFind::find( size_t x )
{
if( x >= m_component.size() )
{
throw WOutOfBounds( "Element index in UnionFind greater than overall elements!" );
throw WOutOfBounds( std::string( "Element index in UnionFind greater than overall elements!" ) );
}
if ( m_component[x] == x ) // we are the root
{
......@@ -60,7 +60,7 @@ void WUnionFind::merge( size_t i, size_t j )
{
if( i >= m_component.size() || j >= m_component.size() )
{
throw WOutOfBounds( "Element index in UnionFind greater than overall elements!" );
throw WOutOfBounds( std::string( "Element index in UnionFind greater than overall elements!" ) );
}
if( i == j )
{
......
......@@ -48,7 +48,7 @@ const wmath::WPosition& WLine::midPoint() const
{
if( empty() )
{
throw WOutOfBounds( "There is no midpoint for an empty line." );
throw WOutOfBounds( std::string( "There is no midpoint for an empty line." ) );
}
return at( ( size() - 1 ) / 2 );
}
......
......@@ -130,7 +130,7 @@ class WThreadedFunctionTest : public CxxTest::TestSuite
*/
void operator() ( std::size_t, std::size_t, WBoolFlag& )
{
throw WException( "Test!" );
throw WException( std::string( "Test!" ) );
}
};
......
......@@ -127,7 +127,7 @@ class WWorkerThreadTest : public CxxTest::TestSuite
*/
void operator() ( std::size_t, std::size_t, WBoolFlag& )
{
throw WException( "Test!" );
throw WException( std::string( "Test!" ) );
}
};
......
......@@ -62,7 +62,7 @@ bool WDataSet::isTexture() const
boost::shared_ptr< WDataTexture3D > WDataSet::getTexture()
{
throw WDHException( "This dataset does not provide a texture." );
throw WDHException( std::string( "This dataset does not provide a texture." ) );
}
const std::string WDataSet::getName() const
......
......@@ -61,7 +61,7 @@ WDataSetTimeSeries::WDataSetTimeSeries( std::vector< boost::shared_ptr< WDataSet
{
if( m_dataSets[ k ].second == m_dataSets[ k - 1 ].second )
{
throw WException( "There are multiple time slices at the same point in time!" );
throw WException( std::string( "There are multiple time slices at the same point in time!" ) );
}
}
}
......@@ -167,7 +167,7 @@ boost::shared_ptr< WDataSetScalar const > WDataSetTimeSeries::calcDataSetAtTime(
vs = calcInterpolatedValueSet< double >( lb, ub, time );
break;
default:
throw WException( "Unsupported datatype in WDataSetTimeSeries::calcDataSetAtTime()" );
throw WException( std::string( "Unsupported datatype in WDataSetTimeSeries::calcDataSetAtTime()" ) );
break;
}
boost::shared_ptr< WDataSetScalar > ds( new WDataSetScalar( vs, m_dataSets.front().first->getGrid() ) );
......
......@@ -37,6 +37,7 @@
#include "../common/WProperties.h"
#include "../common/WTransferable.h"
#include "WDataSetScalar.h"
#include "WExportDataHandler.h"
//! forward declaration
class WDataSetTimeSeriesTest;
......@@ -46,7 +47,7 @@ class WDataSetTimeSeriesTest;
*
* \note Only works for scalar datasets at the moment!
*/
class WDataSetTimeSeries : public WDataSet
class OWDATAHANDLER_EXPORT WDataSetTimeSeries : public WDataSet
{
//! the test is a friend
friend class WDataSetTimeSeriesTest;
......@@ -246,7 +247,7 @@ Data_T WDataSetTimeSeries::interpolate( wmath::WVector3D const& pos, float time,
if( time < getMinTime() || time > getMaxTime() )
{
*success = false;
throw WException( "The provided time is not in the interval of this time series." );
throw WException( std::string( "The provided time is not in the interval of this time series." ) );
}
float lb = getLBTimeSlice( time );
float ub = getUBTimeSlice( time );
......
......@@ -46,30 +46,30 @@ WEEG2::WEEG2( boost::shared_ptr< WPagerEEG > pager, boost::shared_ptr< WEEGPosit
{
if( !pager )
{
throw WDHException( "Couldn't construct new EEG: pager invalid" );
throw WDHException( std::string( "Couldn't construct new EEG: pager invalid" ) );
}
if( !positionsLibrary )
{
throw WDHException( "Couldn't construct new EEG: positions library invalid" );
throw WDHException( std::string( "Couldn't construct new EEG: positions library invalid" ) );
}
std::size_t nbSegments = pager->getNumberOfSegments();
if( nbSegments <= 0 || wlimits::MAX_RECORDING_SEGMENTS < nbSegments )
{
throw WDHException( "Couldn't construct new EEG: invalid number of segments" );
throw WDHException( std::string( "Couldn't construct new EEG: invalid number of segments" ) );
}
std::size_t nbChannels = pager->getNumberOfChannels();
if( nbChannels <= 0 || wlimits::MAX_RECORDING_CHANNELS < nbChannels )
{
throw WDHException( "Couldn't construct new EEG: invalid number of channels" );
throw WDHException( std::string( "Couldn't construct new EEG: invalid number of channels" ) );
}
m_samplingRate = pager->getSamplingRate();
if( m_samplingRate <= 0.0 || wlimits::MAX_RECORDING_SAMPLING_FREQUENCY < m_samplingRate )
{
throw WDHException( "Couldn't construct new EEG: invalid sampling rate" );
throw WDHException( std::string( "Couldn't construct new EEG: invalid sampling rate" ) );
}
setFileName( pager->getFileName() );
......
......@@ -42,7 +42,7 @@ WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG
{
if( !m_pager )
{
throw WDHException( "Couldn't construct new EEG segment: pager invalid" );
throw WDHException( std::string( "Couldn't construct new EEG segment: pager invalid" ) );
}
if( m_segmentID >= m_pager->getNumberOfSegments() )
......@@ -55,7 +55,7 @@ WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG
m_nbSamples = m_pager->getNumberOfSamples( m_segmentID );
if( m_nbSamples <= 0 || wlimits::MAX_RECORDING_SAMPLES < m_nbSamples )
{
throw WDHException( "Couldn't construct new EEG segment: invalid number of samples" );
throw WDHException( std::string( "Couldn't construct new EEG segment: invalid number of samples" ) );
}
}
......
......@@ -43,12 +43,12 @@ WEEGChannelInfo::WEEGChannelInfo( std::size_t channelID,
{
if( !pager )
{
throw WDHException( "Couldn't construct new EEG channel info: pager invalid" );
throw WDHException( std::string( "Couldn't construct new EEG channel info: pager invalid" ) );
}
if( !positionsLibrary )
{
throw WDHException( "Couldn't construct new EEG channel info: positions library invalid" );
throw WDHException( std::string( "Couldn't construct new EEG channel info: positions library invalid" ) );
}
if( channelID >= pager->getNumberOfChannels() )
......@@ -90,6 +90,6 @@ wmath::WPosition WEEGChannelInfo::getPosition() const throw( WDHException )
}
else
{
throw WDHException( "The position of this electrode is unknown." );
throw WDHException( std::string( "The position of this electrode is unknown." ) );
}
}
......@@ -46,7 +46,7 @@ wmath::WPosition WEEGPositionsLibrary::getPosition( std::string label ) const th
if( iter == m_positions.end() )
{
throw WOutOfBounds( "EEG Positions Library doesn't contain a position for electrode " + label );
throw WOutOfBounds( std::string( "EEG Positions Library doesn't contain a position for electrode " + label ) );
}
return iter->second;
......
......@@ -30,14 +30,15 @@
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include "../common/math/WVector3D.h"
#include "WDataSetFiberVector.h"
#include "WDataSetFibers.h"
#include "../common/math/WVector3D.h"
#include "WExportDataHandler.h"
/**
* A class that encapsulates the data needed to construct a WDataSetFibers.
*/
class WFiberAccumulator
class OWDATAHANDLER_EXPORT WFiberAccumulator
{
public:
......
......@@ -177,7 +177,7 @@ namespace wtracking
// dataset != 0 is tested by the base constructor
if( !m_grid )
{
throw WException( "Cannot find WGridRegular3D. Are you sure the dataset has the correct grid type?" );
throw WException( std::string( "Cannot find WGridRegular3D. Are you sure the dataset has the correct grid type?" ) );
}
m_maxPoints = static_cast< std::size_t >( 5 * pow( static_cast< double >( m_grid->size() ), 1.0 / 3.0 ) );
......
......@@ -33,6 +33,7 @@
#include "../common/math/WVector3D.h"
#include "../common/WSharedObject.h"
#include "../common/WThreadedJobs.h"
#include "WExportDataHandler.h"
#include "WDataSetSingle.h"
class WThreadedTrackingFunctionTest; //! forward declaration
......@@ -51,7 +52,7 @@ namespace wtracking // note that this is not final
*
* A class that provides untility functions and typedefs for tracking algorithms.
*/
class WTrackingUtility
class OWDATAHANDLER_EXPORT WTrackingUtility
{
public:
......@@ -138,7 +139,7 @@ namespace wtracking // note that this is not final
* Note that voxels at the first (0) and last (grid->getNbCoords*()) position in any direction are
* invalid seeding voxels as they are partially outside of the grid.
*/
class WThreadedTrackingFunction : public WThreadedJobs< WTrackingUtility::DataSetType, WTrackingUtility::JobType >
class OWDATAHANDLER_EXPORT WThreadedTrackingFunction : public WThreadedJobs< WTrackingUtility::DataSetType, WTrackingUtility::JobType >
{
//! make the test a friend
friend class ::WThreadedTrackingFunctionTest;
......
......@@ -46,17 +46,17 @@ WJoinContourTree::WJoinContourTree( boost::shared_ptr< WDataSetSingle > dataset
{
if( dataset->getValueSet()->order() != 0 || dataset->getValueSet()->dimension() != 1 )
{
throw WNotImplemented( "ATM there is only support for scalar fields" );
throw WNotImplemented( std::string( "ATM there is only support for scalar fields" ) );
}
m_valueSet = boost::shared_dynamic_cast< WValueSet< double > >( dataset->getValueSet() );
if( !m_valueSet )
{
throw WNotImplemented( "ATM there is only support for scalar fields with doubles as scalars" );
throw WNotImplemented( std::string( "ATM there is only support for scalar fields with doubles as scalars" ) );
}
m_grid = boost::shared_dynamic_cast< WGridRegular3D >( dataset->getGrid() );
if( !m_grid )
{
throw WNotImplemented( "Only WGridRegular3D is supported, despite that its not a simplicial mesh!" );
throw WNotImplemented( std::string( "Only WGridRegular3D is supported, despite that its not a simplicial mesh!" ) );
}
for( size_t i = 0; i < m_elementIndices.size(); ++i )
{
......
......@@ -234,7 +234,7 @@ size_t WValueSetHistogram::accumulate( size_t startIndex, size_t endIndex ) cons
// valid index?
if ( endIndex > size() ) // as endIndex is exclusive, it is allowed to equal size()
{
throw WOutOfBounds( "The specified endIndex is out of bounds." );
throw WOutOfBounds( std::string( "The specified endIndex is out of bounds." ) );
}
// unfortunately, shared_array can't be used for std::accumulate
......
......@@ -46,7 +46,7 @@ boost::shared_ptr< WDataSet > WReaderEEGASCII::load()
{
std::ifstream in( m_fname.c_str() );
if( in.fail() )
throw WException( "Could not read file \"" + m_fname + "\"" );
throw WException( std::string( "Could not read file \"" + m_fname + "\"" ) );
std::string tmp;
getline( in, tmp );
......
......@@ -53,7 +53,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
ifs.open( m_fname.c_str(), std::ifstream::in );
if( !ifs || ifs.bad() )
{
throw WDHNoSuchFile( "Problem loading file " + m_fname + ". Probably file not found." );
throw WDHNoSuchFile( std::string( "Problem loading file " + m_fname + ". Probably file not found." ) );
}
std::string line;
......@@ -62,7 +62,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
std::getline( ifs, line );
if( !ifs.good() )
{
throw WDHIOFailure( "Unexpected end of file " + m_fname );
throw WDHIOFailure( std::string( "Unexpected end of file " + m_fname ) );
}
}
......@@ -74,7 +74,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
std::getline( ifs, line );
if( !ifs.good() )
{
throw WDHIOFailure( "Unexpected end of file " + m_fname );
throw WDHIOFailure( std::string( "Unexpected end of file " + m_fname ) );
}
}
......@@ -86,7 +86,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
std::getline( ifs, line );
if( !ifs.good() )
{
throw WDHIOFailure( "Unexpected end of file " + m_fname );
throw WDHIOFailure( std::string( "Unexpected end of file " + m_fname ) );
}
else
{
......@@ -103,7 +103,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
if( positions.size() != numPositions )
{
throw WDHParseError( "Could not find correct number of Positions regarding to NumberPositions statement in file " + m_fname );
throw WDHParseError( std::string( "Could not find correct number of Positions regarding to NumberPositions statement in file " + m_fname ) );
}
while( ifs.good() && line.substr( 0, 6 ) != "Labels" ) // go to line before start of labels
......@@ -111,7 +111,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
std::getline( ifs, line );
if( !ifs.good() )
{
throw WDHIOFailure( "Unexpected end of file " + m_fname );
throw WDHIOFailure( std::string( "Unexpected end of file " + m_fname ) );
}
}
......@@ -122,7 +122,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
std::getline( ifs, line );
if( ifs.fail() )
{
throw WDHIOFailure( "Unexpected end of file " + m_fname );
throw WDHIOFailure( std::string( "Unexpected end of file " + m_fname ) );
}
else
{
......@@ -137,7 +137,7 @@ boost::shared_ptr< WEEGPositionsLibrary > WReaderELC::read()
if( positionsMap.size() != numPositions )
{
throw WDHParseError( "Could not find correct number of Labels regarding to NumberPositions statement in file " + m_fname );
throw WDHParseError( std::string( "Could not find correct number of Labels regarding to NumberPositions statement in file " + m_fname ) );
}
ifs.close();
......
......@@ -59,7 +59,7 @@ boost::shared_ptr< WDataSetFibers > WReaderFiberVTK::read()
m_ifs->open( m_fname.c_str(), std::ifstream::in | std::ifstream::binary );
if( !m_ifs || m_ifs->bad() )
{
throw WDHIOFailure( "internal error while opening" );
throw WDHIOFailure( std::string( "internal error while opening" ) );
}
readHeader();
readPoints();
......@@ -121,7 +121,7 @@ void WReaderFiberVTK::readPoints()
std::vector< std::string > tokens = string_utils::tokenize( line );
if( tokens.size() != 3 || string_utils::toLower( tokens.at( 2 ) ) != "float" )
{
throw WDHParseError( "Invalid POINTS declaration: " + line + ", expected float." );
throw WDHParseError( std::string( "Invalid POINTS declaration: " + line + ", expected float." ) );
}
size_t numPoints = getLexicalCast< size_t >( tokens.at( 1 ), "Invalid number of points" );
......@@ -160,7 +160,7 @@ void WReaderFiberVTK::readLines()
std::vector< std::string > tokens = string_utils::tokenize( line );
if( tokens.size() != 3 || string_utils::toUpper( tokens.at( 0 ) ) != "LINES" )
{
throw WDHException( "Invalid VTK LINES declaration: " + line );
throw WDHException( std::string( "Invalid VTK LINES declaration: " + line ) );
}
size_t numLines = getLexicalCast< size_t >( tokens.at( 1 ), "Invalid number of lines in LINES delclaration" );
size_t linesSize = getLexicalCast< size_t >( tokens.at( 2 ), "Invalid size of lines in LINES delclaration" );
......@@ -209,11 +209,11 @@ std::string WReaderFiberVTK::getLine( const std::string& desc )
}
catch( const std::ios_base::failure &e )
{
throw WDHIOFailure( "IO error while " + desc + " of VTK fiber file: " + m_fname + ", " + e.what() );
throw WDHIOFailure( std::string( "IO error while " + desc + " of VTK fiber file: " + m_fname + ", " + e.what() ) );
}
if( !m_ifs->good() )
{
throw WDHParseError( "Unexpected end of VTK fiber file: " + m_fname );
throw WDHParseError( std::string( "Unexpected end of VTK fiber file: " + m_fname ) );
}
return line;
}
......@@ -147,7 +147,7 @@ template< typename T > inline T WReaderFiberVTK::getLexicalCast( std::string str
}
catch( const boost::bad_lexical_cast &e )
{
throw WDHParseError( "Cast error in VTK fiber file: " + m_fname + ": " + errMsg + ": " + stringValue );
throw WDHParseError( std::string( "Cast error in VTK fiber file: " + m_fname + ": " + errMsg + ": " + stringValue ) );
}
return result;
......
......@@ -62,14 +62,14 @@ void WReaderLookUpTableVTK::readTable( boost::shared_ptr< std::vector< double >
std::getline( ifs, line );
if( !ifs.good() )
{
throw WDHException( "Unexpected end of file: " + m_fname );
throw WDHException( std::string( "Unexpected end of file: " + m_fname ) );
}
header.push_back( line );
}
}
catch( const std::ios_base::failure &e )
{
throw WDHIOFailure( "Reading first 4 lines of '" + m_fname + "': " + e.what() );
throw WDHIOFailure( std::string( "Reading first 4 lines of '" + m_fname + "': " + e.what() ) );
}
WAssert( header[0] == "# vtk DataFile Version 3.0", "Wrong string in file header found." );
WAssert( header[1] == "DXtLookUpTable from OpenWalnut", "Wrong string in file header found." );
......@@ -82,14 +82,14 @@ void WReaderLookUpTableVTK::readTable( boost::shared_ptr< std::vector< double >
}
catch( const std::ios_base::failure &e )
{
throw WDHIOFailure( "Error reading DISTANCES field '" + m_fname + "': " + e.what() );
throw WDHIOFailure( std::string( "Error reading DISTANCES field '" + m_fname + "': " + e.what() ) );
}
namespace su = string_utils;
size_t numDistances = 0;
std::vector< std::string > tokens = su::tokenize( line );
if( tokens.size() != 4 || su::toLower( tokens.at( 3 ) ) != "float" )
{
throw WDHException( "Invalid DISTANCES declaration: " + line );
throw WDHException( std::string( "Invalid DISTANCES declaration: " + line ) );
}
try
{
......@@ -97,7 +97,7 @@ void WReaderLookUpTableVTK::readTable( boost::shared_ptr< std::vector< double >
}
catch( const boost::bad_lexical_cast &e )
{
throw WDHException( "Invalid number of distances: " + tokens.at( 1 ) );
throw WDHException( std::string( "Invalid number of distances: " + tokens.at( 1 ) ) );
}
float *data = new float[ numDistances ];
......@@ -107,7 +107,7 @@ void WReaderLookUpTableVTK::readTable( boost::shared_ptr< std::vector< double >
}
catch( const std::ios_base::failure &e )
{
throw WDHIOFailure( "Error reading distances in VTK DISTANCES field '" + m_fname + "': " + e.what() );
throw WDHIOFailure( std::string( "Error reading distances in VTK DISTANCES field '" + m_fname + "': " + e.what() ) );
}
// all 4 bytes of each float are in wrong order we need to reorder them
......
......@@ -272,7 +272,7 @@ boost::shared_ptr< WDataSet > WReaderNIfTI::load()
}
break;
default:
throw WException( "Unsupported datatype in WReaderNIfTI" );
throw WException( std::string( "Unsupported datatype in WReaderNIfTI" ) );
break;
}
ds.push_back( boost::shared_ptr< WDataSetScalar >( new WDataSetScalar( vs, newGrid ) ) );
......
......@@ -39,6 +39,6 @@ void WWriter::setFileName( std::string fname )
m_fname = fname;
if( !m_overwrite && wiotools::fileExists( m_fname ) )
{
throw WDHIOFailure( "File '" + m_fname + "' already exists, skip writing" );
throw WDHIOFailure( std::string( "File '" + m_fname + "' already exists, skip writing" ) );
}
}
......@@ -45,7 +45,7 @@ void WWriterFiberVTK::writeFibs( boost::shared_ptr< const WDataSetFiberVector >
fstream out( m_fname.c_str(), fstream::out | fstream::in | fstream::trunc );
if( !out || out.bad() )
{
throw WDHIOFailure( "Invalid file, or permission: " + m_fname );
throw WDHIOFailure( std::string( "Invalid file, or permission: " + m_fname ) );
}
// We use '\n' as line delimiter so also files written under windows (having '\r\n' as delimtier) may be read anywhere
char lineDelimiter = '\n';
......
......@@ -43,7 +43,7 @@ void WWriterLookUpTableVTK::writeTable( const std::vector< double > &table, size
fstream out( m_fname.c_str(), fstream::out | fstream::in | fstream::trunc );
if( !out || out.bad() )
{
throw WDHIOFailure( "Invalid file, or permission: " + m_fname );
throw WDHIOFailure( std::string( "Invalid file, or permission: " + m_fname ) );
}
out << "# vtk DataFile Version 3.0" << std::endl;
out << "DXtLookUpTable from OpenWalnut" << std::endl;
......
......@@ -67,7 +67,7 @@ void WGECamera::reset()
setProjectionResizePolicy( osg::Camera::FIXED );
break;
default:
throw WGEInitFailed( "Unknown projection mode" );
throw WGEInitFailed( std::string( "Unknown projection mode" ) );
}
}
......
......@@ -152,7 +152,7 @@ WTriangleMesh wge::triangulate( const std::vector< wmath::WPosition >& points, d
}
else
{
throw WGEException( "Error in triangulation" );
throw WGEException( std::string( "Error in triangulation" ) );
}
}
......
......@@ -77,7 +77,7 @@ WGEViewer::WGEViewer( std::string name, int x, int y,
// no manipulators nor gui handlers
break;
default:
throw WGEInitFailed( "Unknown projection mode" );
throw WGEInitFailed( std::string( "Unknown projection mode" ) );
}
// add the stats handler
......@@ -85,7 +85,7 @@ WGEViewer::WGEViewer( std::string name, int x, int y,
}
catch( ... )
{
throw WGEInitFailed( "Initialization of WGEViewer failed" );
throw WGEInitFailed( std::string( <