From 530e9e08d4f8427d3bf2e98da6221e31c5177668 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 7 Nov 2006 17:00:56 +0000 Subject: [PATCH] Added better handling of writeNode operations that arn't successful. --- applications/osgconv/osgconv.cpp | 13 +++++++-- include/osgDB/ReaderWriter | 2 ++ include/osgDB/Registry | 4 ++- src/osgDB/Registry.cpp | 49 ++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/applications/osgconv/osgconv.cpp b/applications/osgconv/osgconv.cpp index 2d0bd86f3..ebadbf6c0 100644 --- a/applications/osgconv/osgconv.cpp +++ b/applications/osgconv/osgconv.cpp @@ -630,11 +630,20 @@ int main( int argc, char **argv ) std::cout<<"Warning: compressing texture only supported when outputing to .ive"<writeNode(*root,fileNameOut); + if (result.success()) { osg::notify(osg::NOTICE)<<"Data written to '"<writeNode(node,fileName,_options.get()); + if (rr.success()) return rr; else results.push_back(rr); } @@ -1646,6 +1685,16 @@ ReaderWriter::WriteResult Registry::writeNodeImplementation(const Node& node,con return ReaderWriter::WriteResult("Warning: Could not find plugin to write nodes to file \""+fileName+"\"."); } + if (results.front().message().empty()) + { + switch(results.front().status()) + { + case(ReaderWriter::WriteResult::FILE_NOT_HANDLED): results.front().message() = "Warning: Write to \""+fileName+"\" not supported."; break; + case(ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE): results.front().message() = "Warning: Error in writing to \""+fileName+"\"."; break; + default: break; + } + } + return results.front(); }