Validator Class Reference

List of all members.


Detailed Description

Entry point for libSBML's implementation of SBML validation.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

Public Member Functions

void addConstraint (VConstraint *c)
 Adds the given Contraint to this validator.
void clearFailures ()
 Clears the Validator's list of failures.
const unsigned int getCategory () const
 Get the category of validation rules covered by this validator.
const std::list< SBMLError > & getFailures () const
 Get the list of SBMLError objects (if any) logged as a result of running the validator.
virtual void init ()=0
 Initializes this Validator with a set of Constraints.
void logFailure (const SBMLError &msg)
 Adds the given failure to this list of Validators failures.
unsigned int validate (const SBMLDocument &d)
 Validates the given SBMLDocument.
unsigned int validate (const std::string &filename)
 Validates the given SBMLDocument.
 Validator (SBMLErrorCategory_t category=LIBSBML_CAT_SBML)
virtual ~Validator ()

Constructor & Destructor Documentation

Validator::~Validator ( ) [virtual]

Member Function Documentation

Adds the given Contraint to this validator.

Clears the Validator's list of failures.

If you are validating multiple SBML documents with the same Validator, call this method after you have processed the list of failures from the last Validation run and before validating the next document.

const unsigned int Validator::getCategory ( ) const

Get the category of validation rules covered by this validator.

The category values are drawn from the enumeration SBMLErrorCategory_t. See the documentation for the class SBMLError for more information.

const std::list< SBMLError > & Validator::getFailures ( ) const

Get the list of SBMLError objects (if any) logged as a result of running the validator.

Returns:
a list of failures logged during validation.
virtual void Validator::init ( ) [pure virtual]

Initializes this Validator with a set of Constraints.

When creating a subclass of Validator, override this method to add your own Constraints.

void Validator::logFailure ( const SBMLError &  msg)

Adds the given failure to this list of Validators failures.

unsigned int Validator::validate ( const SBMLDocument &  d)

Validates the given SBMLDocument.

Failures logged during validation may be retrieved via getFailures().

Returns:
the number of validation errors that occurred.
unsigned int Validator::validate ( const std::string &  filename)

Validates the given SBMLDocument.

Failures logged during validation may be retrieved via getFailures().

Returns:
the number of validation errors that occurred.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines