]> Creatis software - cpPlugins.git/blob - appli/examples/example_WorkspaceSandBox.cxx
...
[cpPlugins.git] / appli / examples / example_WorkspaceSandBox.cxx
1 #include <cstdlib>
2 #include <iostream>
3 #include <cpPlugins/Interface/Workspace.h>
4
5 #include <tinyxml/tinyxml.h>
6
7 int main( int argc, char* argv[] )
8 {
9   if( argc < 2 )
10   {
11     std::cerr
12       << "Usage: " << argv[ 0 ] << " filename" << std::endl;
13     return( 1 );
14   }
15   std::string filename = argv[ 1 ];
16
17   // Load workspace
18   cpPlugins::Interface::Workspace ws;
19   std::string err = ws.LoadWorkspace( filename );
20   if( err != "" )
21     std::cout
22       << "Errors caught while loading workspace: "
23       << std::endl << err << std::endl;
24
25   err = ws.Execute( );
26   if( err != "" )
27   {
28     std::cerr << "Error caught: " << std::endl << err << std::endl;
29     return( 1 );
30
31   } // fi
32   return( 0 );
33 }
34
35 // eof - $RCSfile$