template<class SBMLExtensionType>
class SBMLExtensionNamespaces< SBMLExtensionType >
Class to store level, version and namespace information of SBML extension package.
|
int | addNamespace (const std::string &uri, const std::string &prefix) |
| Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object. More...
|
|
int | addNamespaces (const XMLNamespaces *xmlns) |
| Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object. More...
|
|
int | addPackageNamespace (const std::string &pkgName, unsigned int pkgVersion, const std::string &prefix="") |
| Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object. More...
|
|
int | addPackageNamespaces (const XMLNamespaces *xmlns) |
| Add the XML namespaces of package extensions in the given XMLNamespace object to the set of namespaces within this SBMLNamespaces object (Non-package XML namespaces are not added by this function). More...
|
|
virtual ISBMLExtensionNamespaces * | clone () const |
| Creates and returns a deep copy of this SBMLExtensionNamespaces. More...
|
|
unsigned int | getLevel () |
| Get the SBML Level of this SBMLNamespaces object. More...
|
|
unsigned int | getLevel () const |
| Get the SBML Level of this SBMLNamespaces object. More...
|
|
XMLNamespaces * | getNamespaces () |
| Get the XML namespaces list for this SBMLNamespaces object. More...
|
|
const XMLNamespaces * | getNamespaces () const |
| Get the XML namespaces list for this SBMLNamespaces object. More...
|
|
virtual const std::string & | getPackageName () const |
| Returns the name of the main package for this namespace. More...
|
|
unsigned int | getPackageVersion () const |
| Get the SBML Package Version of this SBMLExtensionNamespaces object. More...
|
|
virtual std::string | getURI () const |
| Returns a string representing the Package XML namespace of this object. More...
|
|
unsigned int | getVersion () |
| Get the SBML Version of this SBMLNamespaces object. More...
|
|
unsigned int | getVersion () const |
| Get the SBML Version of this SBMLNamespaces object. More...
|
|
bool | isValidCombination () |
| Predicate returning true if the given set of namespaces represent a valid set. More...
|
|
SBMLExtensionNamespaces & | operator= (const SBMLExtensionNamespaces &orig) |
| Assignment operator for SBMLExtensionNamespaces. More...
|
|
int | removeNamespace (const std::string &uri) |
| Removes an XML namespace from the set of namespaces within this SBMLNamespaces object. More...
|
|
int | removePackageNamespace (unsigned int level, unsigned version, const std::string &pkgName, unsigned int pkgVersion) |
| Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object. More...
|
|
| SBMLExtensionNamespaces (unsigned int level=SBMLExtensionType::getDefaultLevel(), unsigned int version=SBMLExtensionType::getDefaultVersion(), unsigned int pkgVersion=SBMLExtensionType::getDefaultPackageVersion(), const std::string &prefix=SBMLExtensionType::getPackageName()) |
| Creates a new SBMLExtensionNamespaces object corresponding to the given SBML level , version and package version. More...
|
|
| SBMLExtensionNamespaces (const SBMLExtensionNamespaces &orig) |
| Copy constructor; creates a copy of a SBMLExtensionNamespaces. More...
|
|
virtual | ~SBMLExtensionNamespaces () |
| Destroys this SBMLExtensionNamespaces object. More...
|
|
Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object.
The following code gives an example of how one could add the XHTML namespace to the list of namespaces recorded by the top-level <sbml>
element of a model. It gives the new namespace a prefix of html
.
SBMLDocument *sd;
try
{
sd = new SBMLDocument(3, 1);
}
catch (SBMLConstructorException e)
{
// Here, have code to handle a truly exceptional situation. Candidate
// causes include invalid combinations of SBML Level and Version
// (impossible if hardwired as given here), running out of memory, and
// unknown system exceptions.
}
SBMLNamespaces sn = sd->getNamespaces();
if (sn != NULL)
{
sn->add("http://www.w3.org/1999/xhtml", "html");
}
else
{
// Handle another truly exceptional situation.
}
- Parameters
-
xmlns | the XML namespaces to be added. |
- Returns
- integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Get the XML namespaces list for this SBMLNamespaces object.
The plural is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model, and therefore there may be multiple XML namespaces involved too. However, until the introduction of SBML Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time, and so this method will also only return a list of one item.
- Returns
- the XML namespaces of this SBMLNamespaces object.
Get the XML namespaces list for this SBMLNamespaces object.
The plural is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model, and therefore there may be multiple XML namespaces involved too. However, until the introduction of SBML Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time, and so this method will also only return a list of one item.
- Returns
- the XML namespaces of this SBMLNamespaces object.