Added ability for OSG serializers to get the file version number when writing out via the OutputStream object

remotes/origin/Deprecated_master_20th_November_2022
Robert Osfield 7 years ago
parent da7a0968be
commit 9f3533632a

@ -12,17 +12,22 @@ namespace osgDB
// forward declare
class InputStream;
class OutputStream;
class OSGDB_EXPORT OutputIterator : public osg::Referenced
{
public:
OutputIterator() : _out(0), _supportBinaryBrackets(false) {}
OutputIterator() : _out(0), _outputStream(0), _supportBinaryBrackets(false) {}
virtual ~OutputIterator() {}
void setStream( std::ostream* ostream ) { _out = ostream; }
std::ostream* getStream() { return _out; }
const std::ostream* getStream() const { return _out; }
void setOutputStream( OutputStream* outputStream) { _outputStream = outputStream; }
OutputStream* getOutputStream() { return _outputStream; }
const OutputStream* getOutputStream() const { return _outputStream; }
void setSupportBinaryBrackets( bool b ) { _supportBinaryBrackets = b; }
bool getSupportBinaryBrackets() const { return _supportBinaryBrackets; }
@ -69,6 +74,7 @@ protected:
}
std::ostream* _out;
osgDB::OutputStream* _outputStream;
bool _supportBinaryBrackets;
};

@ -706,6 +706,8 @@ void OutputStream::start( OutputIterator* outIterator, OutputStream::WriteType t
throwException( "OutputStream: Null stream specified." );
if ( getException() ) return;
_out->setOutputStream(this);
if ( isBinary() )
{
*this << (unsigned int)type << (unsigned int)OPENSCENEGRAPH_SOVERSION;

Loading…
Cancel
Save