Prints information about the top-level model in the given SBML file.
#include <iostream>
using namespace std;
LIBSBML_CPP_NAMESPACE_USE
int
main (int argc, char* argv[])
{
if (argc != 2)
{
cout << endl << "Usage: printSBML filename" << endl << endl;
return 1;
}
const char* filename = argv[1];
{
cerr << "Encountered the following SBML errors:" << endl;
return 1;
}
unsigned int level = document->
getLevel ();
cout << endl
<< "File: " << filename
<< " (Level " << level << ", version " << version << ")" << endl;
if (model == 0)
{
cout << "No model present." << endl;
return 1;
}
cout << " "
<< (level == 1 ? "name: " : " id: ")
<< (model->
isSetId() ? model->
getId() : std::string(
"(empty)")) << endl;
cout <<
" model sboTerm: " << model->
getSBOTerm() << endl;
cout << endl;
delete document;
return 0;
}
SBMLDocument_t * readSBML(const char *filename)
Reads an SBML document from the given file.
Include all SBML types in a single header file.
unsigned int getNumSpecies() const
Get the number of Species objects in this Model.
Definition: Model.cpp:3123
unsigned int getNumFunctionDefinitions() const
Get the number of FunctionDefinition objects in this Model.
Definition: Model.cpp:3073
unsigned int getNumParameters() const
Get the number of Parameter objects in this Model.
Definition: Model.cpp:3152
unsigned int getNumSpeciesTypes() const
Get the number of SpeciesType objects in this Model.
Definition: Model.cpp:3103
unsigned int getNumRules() const
Get the number of Rule objects in this Model.
Definition: Model.cpp:3172
unsigned int getNumInitialAssignments() const
Get the number of InitialAssignment objects in this Model.
Definition: Model.cpp:3162
unsigned int getNumCompartmentTypes() const
Get the number of CompartmentType objects in this Model.
Definition: Model.cpp:3093
unsigned int getNumUnitDefinitions() const
Get the number of UnitDefinition objects in this Model.
Definition: Model.cpp:3083
unsigned int getNumCompartments() const
Get the number of Compartment objects in this Model.
Definition: Model.cpp:3113
unsigned int getNumReactions() const
Get the number of Reaction objects in this Model.
Definition: Model.cpp:3192
virtual bool isSetId() const
Predicate returning true if this Model's "id" attribute is set.
Definition: Model.cpp:618
virtual const std::string & getId() const
Returns the value of the "id" attribute of this Model.
unsigned int getNumConstraints() const
Get the number of Constraint objects in this Model.
Definition: Model.cpp:3182
unsigned int getNumEvents() const
Get the number of Event objects in this Model.
Definition: Model.cpp:3202
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
const Model * getModel() const
Returns the Model object stored in this SBMLDocument.
Definition: SBMLDocument.cpp:350
bool isSetSBOTerm() const
Predicate returning true if this object's "sboTerm" attribute is set.
Definition: SBase.cpp:1166
int getSBOTerm() const
Returns the integer portion of the value of the "sboTerm" attribute of this object.
Definition: SBase.cpp:998
unsigned int getVersion() const
Returns the Version within the SBML Level of the SBMLDocument object containing this object.
Definition: SBase.cpp:3142
unsigned int getLevel() const
Returns the SBML Level of the SBMLDocument object containing this object.
Definition: SBase.cpp:3127