Loads an SBML File and inlines all the function definitions found in the model.
#include <iostream>
using namespace std;
LIBSBML_CPP_NAMESPACE_USE
int
main (int argc, char *argv[])
{
if (argc != 3)
{
cout
<< endl
<< "Usage: inlineFunctionDefintions input-filename output-filename" << endl
<< endl
<< "This program will attempt to inline all function definitions" << endl
<< "contained in the source model, and write a new SBML file."
<< endl
<< endl;
return 1;
}
const char* inputFile = argv[1];
const char* outputFile = argv[2];
if (errors > 0)
{
cerr << "Encountered the following SBML errors:" << endl;
cerr << "Conversion skipped. Please correct the problems above first."
<< endl;
return errors;
}
props.
addOption(
"expandFunctionDefinitions",
true,
"Expand all function definitions in the model");
int success = document->
convert(props);
{
cerr << "Unable to perform conversion due to the following:" << endl;
return errors;
}
else
{
cout << "Conversion completed." << endl;
}
delete document;
return 0;
}
Definition of ConversionProperties, the class encapsulating conversion configuration.
SBMLDocument_t * readSBML(const char *filename)
Reads an SBML document from the given file.
Include all SBML types in a single header file.
int writeSBML(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file named by filename.
@ LIBSBML_SEV_ERROR
Definition: XMLError.h:534
Definition: ConversionProperties.h:84
virtual void addOption(const ConversionOption &option)
Adds a copy of the given option to this properties object.
Definition: ConversionProperties.cpp:232
Definition: SBMLDocument.h:349
unsigned int getNumErrors() const
Returns the number of errors or warnings encountered during parsing, consistency checking,...
Definition: SBMLDocument.cpp:1163
void printErrors(std::ostream &stream=std::cerr) const
Prints all the errors or warnings encountered trying to parse, check, or translate this SBML document...
Definition: SBMLDocument.cpp:1186
virtual int convert(const ConversionProperties &props)
Converts this document using the converter that best matches the given conversion properties.
@ LIBSBML_OPERATION_SUCCESS
Definition: operationReturnValues.h:61