bool OSBDriver::writeFC( FieldContainer * const fc, std::ostream &outStream, const IOFileTypeBase::OptionSet &options ) { OSBRootElement *root = dynamic_cast<OSBRootElement *>( OSBElementFactory::the()->acquire("RootElement", 0)); root->initialiseWrite(outStream); root->editOptions ( ).init(options); root->preWrite(fc); root->write ( ); root->terminateWrite(); OSBElementFactory::the()->release(root); return true; }
/*! Reads from \a inStream which must provide access to an ".osb" file. \param[in] inStream Stream to read data from. \param[in] optionStr String that holds the options for the read operation. \return On success a pointer to the container read from the file. NULL otherwise. */ FieldContainerTransitPtr OSBDriver::readFC( std::istream &inStream, const IOFileTypeBase::OptionSet &options ) { FieldContainerTransitPtr retVal; OSBRootElement *root = dynamic_cast<OSBRootElement *>( OSBElementFactory::the()->acquire("RootElement", 0)); root->initialiseRead(inStream); root->editOptions ( ).init(options); root->read (""); root->postRead( ); retVal = root->getContainer(); root->terminateRead(); OSBElementFactory::the()->release(root); return retVal; }