Example that shows how to call an external program for validation.
#include <iostream>
#include <string>
#include <vector>
int
main (int argc, char *argv[])
{
if (argc < 3)
{
cout << endl << "Usage: callExternalValidator filename externalValidator [ tempSBMLFile outputFile [ ADDITIONAL-ARGS] ]" << endl << endl;
return 1;
}
string filename = argv[1];
string externalValidator = argv[2];
string tempSBMLFileName = filename + "_temp.xml";
if (argc > 3)
tempSBMLFileName = argv[3];
string outputFile = filename + "_out.xml";
if (argc > 4)
outputFile = argv[4];
vector<string> additionalArgs;
for (int i = 5; i < argc; i++)
additionalArgs.push_back(argv[i]);
additionalArgs.push_back(outputFile);
SBMLExternalValidator validator;
validator.setProgram(externalValidator);
validator.setSBMLFileName(tempSBMLFileName);
validator.setOutputFileName(outputFile);
validator.setArguments(additionalArgs);
document->setApplicableValidators(0);
document->addValidator(&validator);
return numErrors;
}