TiXmlDocument* doc = new TiXmlDocument( fname.c_str( ) );
doc->LoadFile( );
TiXmlElement* root = doc->RootElement( );
+ if( root == NULL )
+ return( "cpPlugins::Interface::Workspace: No valid file" );
if( std::string( root->Value( ) ) != "cpPlugins_Workspace" )
return( "cpPlugins::Interface::Workspace: No valid workspace" );
std::stringstream err;
std::string cpPlugins::Interface::Workspace::
SaveWorkspace( const std::string& fname ) const
{
- return( "" );
+ std::stringstream err;
+ TiXmlDocument* doc = new TiXmlDocument( );
+ TiXmlElement* root = new TiXmlElement( "cpPlugins_Workspace" );
+
+ // Save plugins
+ for(
+ auto plugIt = this->m_LoadedPlugins.begin( );
+ plugIt != this->m_LoadedPlugins.end( );
+ ++plugIt
+ )
+ {
+ TiXmlElement* plugin = new TiXmlElement( "plugins" );
+ plugin->SetAttribute( "filename", plugIt->c_str( ) );
+ root->LinkEndChild( plugin );
+
+ } // rof
+
+ // Save vertices
+ auto vIt = this->m_Graph->BeginVertices( );
+ for( ; vIt != this->m_Graph->EndVertices( ); ++vIt )
+ {
+ auto filter = dynamic_cast< TFilter* >( vIt->second.GetPointer( ) );
+ auto data = dynamic_cast< TData* >( vIt->second.GetPointer( ) );
+ if( filter != NULL )
+ {
+ }
+ else if( data != NULL )
+ {
+ } // fi
+
+ } // rof
+
+ // Physical write and return
+ doc->LinkEndChild( root );
+ doc->SaveFile( fname.c_str( ) );
+ delete doc;
+ return( err.str( ) );
}
// eof - $RCSfile$