Example #3 from the SBML Level 3 Hierarchical Model Composition specification.
#include <iostream>
#include <sstream>
#ifdef WIN32
#include <conio.h>
#endif
int main(int argc,char** argv)
{
int retval = 0;
extmod->
setId(
"ExtMod1");
model->
setId(
"complexified");
delete document;
if (document == NULL)
{
cout << "Error reading back in file." << endl;
retval = -1;
}
else
{
{
stringstream errorstream;
cout << "Errors encoutered when round-tripping SBML file: \n"
<< errorstream.str() << endl;
retval = -1;
}
delete document;
}
#ifdef WIN32
if (retval != 0)
{
cout << "(Press any key to exit.)" << endl;
_getch();
}
#endif
return retval;
}