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:
Robert Osfield
2016-01-19 17:39:03 +00:00
parent 845bb6aceb
commit ff1051a6fd
8 changed files with 99 additions and 105 deletions

View File

@@ -161,6 +161,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
std::string& message() { return _message; }
const std::string& message() const { return _message; }
/// report the ReadResult's status, and message (if any). Useful for reporting of errors to users.
std::string statusMessage() const;
ReadStatus status() const { return _status; }
bool success() const { return _status==FILE_LOADED || _status==FILE_LOADED_FROM_CACHE ; }
bool loadedFromCache() const { return _status==FILE_LOADED_FROM_CACHE; }
@@ -200,6 +203,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
std::string& message() { return _message; }
const std::string& message() const { return _message; }
/// Report the WriteResult's status, and message (if any). Useful for reporting of errors to users.
std::string statusMessage() const;
WriteStatus status() const { return _status; }
bool success() const { return _status==FILE_SAVED; }
bool error() const { return _status==ERROR_IN_WRITING_FILE; }