From Jannik Heller and Robert Osfield, introduced ReadResult/WriteResult::statusMessage() method that creates a std::string from the stutus value and message string.
This commit is contained in:
@@ -27,7 +27,7 @@ using namespace osgDB;
|
||||
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeObject( object, filename, options );
|
||||
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
if (!wr.success()) OSG_WARN << "Error writing file " << filename << ": " << wr.statusMessage() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ bool osgDB::writeObjectFile(const Object& object,const std::string& filename, co
|
||||
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeImage( image, filename, options );
|
||||
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
if (!wr.success()) OSG_WARN << "Error writing file " << filename << ": " << wr.statusMessage() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
@@ -43,28 +43,28 @@ bool osgDB::writeImageFile(const Image& image,const std::string& filename, const
|
||||
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField( HeightField, filename, options );
|
||||
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
if (!wr.success()) OSG_WARN << "Error writing file " << filename << ": " << wr.statusMessage() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeNode( node, filename, options );
|
||||
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
if (!wr.success()) OSG_WARN << "Error writing file " << filename << ": " << wr.statusMessage() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options );
|
||||
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
if (!wr.success()) OSG_WARN << "Error writing file " << filename << ": " << wr.statusMessage() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
bool osgDB::writeScriptFile(const Script& image,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeScript( image, filename, options );
|
||||
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
if (!wr.success()) OSG_WARN << "Error writing file " << filename << ": " << wr.statusMessage() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user