libCombine  0.1.0
C++ library for working with the COMBINE Archive format
CaOmexManifest Class Reference

{combine} TODO:Definition of the CaOmexManifest class. More...

#include <CaOmexManifest.h>

+ Inheritance diagram for CaOmexManifest:

Public Member Functions

 CaOmexManifest ()
 Creates a new CaOmexManifest instance. More...
 
 CaOmexManifest (CaNamespaces *omexns)
 Creates a new CaOmexManifest using the given CaNamespaces object omexns. More...
 
 CaOmexManifest (const CaOmexManifest &orig)
 Copy constructor for CaOmexManifest. More...
 
CaOmexManifestoperator= (const CaOmexManifest &rhs)
 Assignment operator for CaOmexManifest. More...
 
virtual CaOmexManifestclone () const
 Creates and returns a deep copy of this CaOmexManifest object. More...
 
virtual ~CaOmexManifest ()
 Destructor for CaOmexManifest. More...
 
const CaListOfContentsgetListOfContents () const
 Returns the CaListOfContents from this CaOmexManifest. More...
 
CaListOfContentsgetListOfContents ()
 Returns the CaListOfContents from this CaOmexManifest. More...
 
CaContentgetContent (unsigned int n)
 Get a CaContent from the CaOmexManifest. More...
 
const CaContentgetContent (unsigned int n) const
 Get a CaContent from the CaOmexManifest. More...
 
int addContent (const CaContent *cc)
 Adds a copy of the given CaContent to this CaOmexManifest. More...
 
unsigned int getNumContents () const
 Get the number of CaContent objects in this CaOmexManifest. More...
 
CaContentcreateContent ()
 Creates a new CaContent object, adds it to this CaOmexManifest object and returns the CaContent object created. More...
 
CaContentremoveContent (unsigned int n)
 Removes the nth CaContent from this CaOmexManifest and returns a pointer to it. More...
 
virtual const std::string & getElementName () const
 Returns the XML element name of this CaOmexManifest object. More...
 
virtual int getTypeCode () const
 Returns the libCombine type code for this CaOmexManifest object. More...
 
virtual bool hasRequiredElements () const
 Predicate returning true if all the required elements for this CaOmexManifest object have been set. More...
 
virtual CaBasegetElementBySId (const std::string &id)
 Returns the first child element that has the given id in the model-wide SId namespace, or NULL if no such object is found. More...
 
virtual const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * getNamespaces () const
 Returns the value of the "Namespaces" element of this CaOmexManifest. More...
 
virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * getNamespaces ()
 Returns the value of the "Namespaces" element of this CaOmexManifest. More...
 
const CaErrorLoggetErrorLog () const
 Returns the value of the "CaErrorLog" element of this CaOmexManifest. More...
 
CaErrorLoggetErrorLog ()
 Returns the value of the "CaErrorLog" element of this CaOmexManifest. More...
 
CaErrorgetError (unsigned int n)
 Get a CaError from the CaDocument. More...
 
const CaErrorgetError (unsigned int n) const
 Get a CaError from the CaDocument. More...
 
unsigned int getNumErrors () const
 Get the number of CaError objects in this CaDocument. More...
 
unsigned int getNumErrors (unsigned int severity) const
 Get the number of CaError objects in this CaDocument with the given severity. More...
 
virtual unsigned int getLevel () const
 return the level of this document More...
 
virtual unsigned int getVersion () const
 return the version of this document More...
 
- Public Member Functions inherited from CaBase
virtual ~CaBase ()
 Destroys this object. More...
 
CaBaseoperator= (const CaBase &rhs)
 Assignment operator for CaBase. More...
 
virtual const CaBasegetElementBySId (const std::string &metaid) const
 Returns the first child element it can find with a specific "id" attribute value, or NULL if no such object is found. More...
 
virtual CaBasegetElementByMetaId (const std::string &metaid)
 Returns the first child element it can find with a specific "metaid" attribute value, or NULL if no such object is found. More...
 
virtual const CaBasegetElementByMetaId (const std::string &metaid) const
 Returns the first child element it can find with a specific "metaid" attribute value, or NULL if no such object is found. More...
 
virtual List * getAllElements ()
 Returns a List of all child CaBase objects, including those nested to an arbitrary depth. More...
 
const std::string & getMetaId () const
 Returns the value of the "metaid" attribute of this object. More...
 
std::string & getMetaId ()
 Returns the value of the "metaid" attribute of this object. More...
 
virtual const std::string & getId () const
 
XMLNode * getNotes ()
 Returns the content of the "notes" subelement of this object as a tree of XMLNode objects. More...
 
const XMLNode * getNotes () const
 Returns the content of the "notes" subelement of this object as a tree of XMLNode objects. More...
 
std::string getNotesString ()
 Returns the content of the "notes" subelement of this object as a string. More...
 
std::string getNotesString () const
 Returns the content of the "notes" subelement of this object as a string. More...
 
XMLNode * getAnnotation ()
 Returns the content of the "annotation" subelement of this object as a tree of XMLNode objects. More...
 
const XMLNode * getAnnotation () const
 Returns the content of the "annotation" subelement of this object as a tree of XMLNode objects. More...
 
std::string getAnnotationString ()
 Returns the content of the "annotation" subelement of this object as a character string. More...
 
std::string getAnnotationString () const
 Returns the content of the "annotation" subelement of this object as a character string. More...
 
const CaOmexManifestgetCaOmexManifest () const
 Returns the CaOmexManifest object containing this object instance. More...
 
CaOmexManifestgetCaOmexManifest ()
 Returns the CaOmexManifest object containing this object instance. More...
 
CaBasegetParentCaObject ()
 Returns the parent OMEX object containing this object. More...
 
const CaBasegetParentCaObject () const
 Returns the parent OMEX object containing this object. More...
 
CaBasegetAncestorOfType (int type)
 Returns the first ancestor object that has the given OMEX type code. More...
 
const CaBasegetAncestorOfType (int type) const
 Returns the first ancestor object that has the given OMEX type code. More...
 
unsigned int getLine () const
 Returns the line number on which this object first appears in the XML representation of the OMEX document, or '0' if the object was created, not read from a file. More...
 
unsigned int getColumn () const
 Returns the column number on which this object first appears in the XML representation of the OMEX document, or '0' if the object was created, not read from a file. More...
 
bool isSetMetaId () const
 Predicate returning true if this object's "metaid" attribute is set. More...
 
virtual bool isSetId () const
 Predicate returning true if this object's "id" attribute is set. More...
 
bool isSetNotes () const
 Predicate returning true if this object's "notes" subelement exists and has content. More...
 
bool isSetAnnotation () const
 Predicate returning true if this object's "annotation" subelement exists and has content. More...
 
int setMetaId (const std::string &metaid)
 Sets the value of the meta-identifier attribute of this object. More...
 
virtual int setAnnotation (XMLNode *annotation)
 Sets the value of the "annotation" subelement of this OMEX object. More...
 
virtual int setAnnotation (const std::string &annotation)
 Sets the value of the "annotation" subelement of this OMEX object. More...
 
virtual int appendAnnotation (const XMLNode *annotation)
 Appends the given annotation to the "annotation" subelement of this object. More...
 
virtual int appendAnnotation (const std::string &annotation)
 Appends the given annotation to the "annotation" subelement of this object. More...
 
int removeTopLevelAnnotationElement (const std::string elementName, const std::string elementURI="")
 Removes the top-level element within the "annotation" subelement of this OMEX object with the given name and optional URI. More...
 
int replaceTopLevelAnnotationElement (const XMLNode *annotation)
 Replaces the given top-level element within the "annotation" subelement of this OMEX object and with the annotation element supplied. More...
 
int replaceTopLevelAnnotationElement (const std::string &annotation)
 Replaces the given top-level element within the "annotation" subelement of this OMEX object and with the annotation element supplied. More...
 
int setNotes (const XMLNode *notes)
 Sets the value of the "notes" subelement of this OMEX object. More...
 
int setNotes (const std::string &notes, bool addXHTMLMarkup=false)
 Sets the value of the "notes" subelement of this OMEX object to a copy of the string notes. More...
 
int appendNotes (const XMLNode *notes)
 Appends the given notes to the "notes" subelement of this object. More...
 
int appendNotes (const std::string &notes)
 Appends the given notes to the "notes" subelement of this object. More...
 
int setNamespaces (XMLNamespaces *xmlns)
 Sets the namespaces relevant of this OMEX object. More...
 
int unsetMetaId ()
 Unsets the value of the "metaid" attribute of this OMEX object. More...
 
int unsetNotes ()
 Unsets the value of the "notes" subelement of this OMEX object. More...
 
int unsetAnnotation ()
 Unsets the value of the "annotation" subelement of this OMEX object. More...
 
unsigned int getLevel () const
 Returns the OMEX Level of the CaOmexManifest object containing this object. More...
 
unsigned int getVersion () const
 Returns the Version within the OMEX Level of the CaOmexManifest object containing this object. More...
 
bool hasValidLevelVersionNamespaceCombination ()
 Predicate returning true if this object's level/version and namespace values correspond to a valid OMEX specification. More...
 
char * toCa ()
 Returns a string consisting of a partial OMEX corresponding to just this object. More...
 
virtual int removeFromParentAndDelete ()
 Removes this object from its parent. More...
 
bool matchesCaNamespaces (const CaBase *sb)
 Returns true if this object's set of XML namespaces are the same as the given object's XML namespaces. More...
 
bool matchesCaNamespaces (const CaBase *sb) const
 Returns true if this object's set of XML namespaces are the same as the given object's XML namespaces. More...
 
bool matchesRequiredCaNamespacesForAddition (const CaBase *sb)
 Returns true if this object's set of XML namespaces are a subset of the given object's XML namespaces. More...
 
bool matchesRequiredCaNamespacesForAddition (const CaBase *sb) const
 Returns true if this object's set of XML namespaces are a subset of the given object's XML namespaces. More...
 
int setUserData (void *userData)
 Sets the user data of this element. More...
 
void * getUserData () const
 Returns the user data that has been previously set via setUserData(). More...
 
bool isSetUserData () const
 Predicate returning true or false depending on whether the user data of this element has been set. More...
 
int unsetUserData ()
 Unsets the user data of this element. More...
 
CaErrorLoggetErrorLog ()
 Returns the CaErrorLog used to log errors while reading and validating OMEX. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CaBase
bool getHasBeenDeleted () const
 
virtual void setElementText (const std::string &text)
 When overridden allows CaBase elements to use the text included in between the elements tags. More...
 

Detailed Description

{combine} TODO:Definition of the CaOmexManifest class.

Constructor & Destructor Documentation

§ CaOmexManifest() [1/3]

CaOmexManifest::CaOmexManifest ( )

Creates a new CaOmexManifest instance.

§ CaOmexManifest() [2/3]

CaOmexManifest::CaOmexManifest ( CaNamespaces omexns)

Creates a new CaOmexManifest using the given CaNamespaces object omexns.

Parameters
omexnsthe CaNamespaces object.
Exceptions
OMEXConstructorExceptionThrown if the given level and version combination, or this kind of OMEX object, are either invalid or mismatched with respect to the parent CaOmexManifest object.

§ CaOmexManifest() [3/3]

CaOmexManifest::CaOmexManifest ( const CaOmexManifest orig)

Copy constructor for CaOmexManifest.

Parameters
origthe CaOmexManifest instance to copy.

§ ~CaOmexManifest()

virtual CaOmexManifest::~CaOmexManifest ( )
virtual

Destructor for CaOmexManifest.

Member Function Documentation

§ addContent()

int CaOmexManifest::addContent ( const CaContent cc)

Adds a copy of the given CaContent to this CaOmexManifest.

Parameters
ccthe CaContent object to add.
  • {LIBCOMBINE_OPERATION_SUCCESS, OperationReturnValues_t}
  • {LIBCOMBINE_OPERATION_FAILED, OperationReturnValues_t}
See also
createContent()

§ clone()

virtual CaOmexManifest* CaOmexManifest::clone ( ) const
virtual

Creates and returns a deep copy of this CaOmexManifest object.

Returns
a (deep) copy of this CaOmexManifest object.

Implements CaBase.

§ createContent()

CaContent* CaOmexManifest::createContent ( )

Creates a new CaContent object, adds it to this CaOmexManifest object and returns the CaContent object created.

Returns
a new CaContent object instance.
See also
addContent(const CaContent* cc)

§ getContent() [1/2]

CaContent* CaOmexManifest::getContent ( unsigned int  n)

Get a CaContent from the CaOmexManifest.

Parameters
nan unsigned int representing the index of the CaContent to retrieve.
Returns
the nth CaContent in the CaListOfContents within this CaOmexManifest.
See also
getNumContents()

§ getContent() [2/2]

const CaContent* CaOmexManifest::getContent ( unsigned int  n) const

Get a CaContent from the CaOmexManifest.

Parameters
nan unsigned int representing the index of the CaContent to retrieve.
Returns
the nth CaContent in the CaListOfContents within this CaOmexManifest.
See also
getNumContents()

§ getElementBySId()

virtual CaBase* CaOmexManifest::getElementBySId ( const std::string &  id)
virtual

Returns the first child element that has the given id in the model-wide SId namespace, or NULL if no such object is found.

Parameters
ida string representing the id attribute of the object to retrieve.
Returns
a pointer to the CaBase element with the given id.

Reimplemented from CaBase.

§ getElementName()

virtual const std::string& CaOmexManifest::getElementName ( ) const
virtual

Returns the XML element name of this CaOmexManifest object.

For CaOmexManifest, the XML element name is always "omexManifest".

Returns
the name of this element, i.e. "omexManifest".

Implements CaBase.

§ getError() [1/2]

CaError* CaOmexManifest::getError ( unsigned int  n)

Get a CaError from the CaDocument.

Parameters
nan unsigned int representing the index of the CaError to retrieve.
Returns
the nth CaError in the CaListOfErrors within this CaDocument.
See also
getNumErrors()

§ getError() [2/2]

const CaError* CaOmexManifest::getError ( unsigned int  n) const

Get a CaError from the CaDocument.

Parameters
nan unsigned int representing the index of the CaError to retrieve.
Returns
the nth CaError in the CaListOfErrors within this CaDocument.
See also
getNumErrors()

§ getErrorLog() [1/2]

const CaErrorLog* CaOmexManifest::getErrorLog ( ) const

Returns the value of the "CaErrorLog" element of this CaOmexManifest.

Returns
the value of the "CaErrorLog" element of this CaOmexManifest as a CaErrorLog*.

§ getErrorLog() [2/2]

CaErrorLog* CaOmexManifest::getErrorLog ( )

Returns the value of the "CaErrorLog" element of this CaOmexManifest.

Returns
the value of the "CaErrorLog" element of this CaOmexManifest as a CaErrorLog*.

§ getLevel()

virtual unsigned int CaOmexManifest::getLevel ( ) const
virtual

return the level of this document

§ getListOfContents() [1/2]

const CaListOfContents* CaOmexManifest::getListOfContents ( ) const

Returns the CaListOfContents from this CaOmexManifest.

Returns
the CaListOfContents from this CaOmexManifest.

§ getListOfContents() [2/2]

CaListOfContents* CaOmexManifest::getListOfContents ( )

Returns the CaListOfContents from this CaOmexManifest.

Returns
the CaListOfContents from this CaOmexManifest.

§ getNamespaces() [1/2]

virtual const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces* CaOmexManifest::getNamespaces ( ) const
virtual

Returns the value of the "Namespaces" element of this CaOmexManifest.

Returns
the value of the "Namespaces" element of this CaOmexManifest as a LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces*.

Reimplemented from CaBase.

§ getNamespaces() [2/2]

virtual LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces* CaOmexManifest::getNamespaces ( )
virtual

Returns the value of the "Namespaces" element of this CaOmexManifest.

Returns
the value of the "Namespaces" element of this CaOmexManifest as a LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces*.

Reimplemented from CaBase.

§ getNumContents()

unsigned int CaOmexManifest::getNumContents ( ) const

Get the number of CaContent objects in this CaOmexManifest.

Returns
the number of CaContent objects in this CaOmexManifest.

§ getNumErrors() [1/2]

unsigned int CaOmexManifest::getNumErrors ( ) const

Get the number of CaError objects in this CaDocument.

Returns
the number of CaError objects in this CaDocument.

§ getNumErrors() [2/2]

unsigned int CaOmexManifest::getNumErrors ( unsigned int  severity) const

Get the number of CaError objects in this CaDocument with the given severity.

Parameters
severitythe severity of the CaError to return.
Returns
the number of CaError objects in this CaDocument.

§ getTypeCode()

virtual int CaOmexManifest::getTypeCode ( ) const
virtual

Returns the libCombine type code for this CaOmexManifest object.

Returns
the OMEX type code for this object:

{LIB_COMBINE_OMEXMANIFEST, OMEXCombineTypeCode_t}

See also
getElementName()

Reimplemented from CaBase.

§ getVersion()

virtual unsigned int CaOmexManifest::getVersion ( ) const
virtual

return the version of this document

§ hasRequiredElements()

virtual bool CaOmexManifest::hasRequiredElements ( ) const
virtual

Predicate returning true if all the required elements for this CaOmexManifest object have been set.

Returns
true to indicate that all the required elements of this CaOmexManifest have been set, otherwise false is returned.
Note
The required elements for the CaOmexManifest object are:

§ operator=()

CaOmexManifest& CaOmexManifest::operator= ( const CaOmexManifest rhs)

Assignment operator for CaOmexManifest.

Parameters
rhsthe CaOmexManifest object whose values are to be used as the basis of the assignment.

§ removeContent()

CaContent* CaOmexManifest::removeContent ( unsigned int  n)

Removes the nth CaContent from this CaOmexManifest and returns a pointer to it.

Parameters
nan unsigned int representing the index of the CaContent to remove.
Returns
a pointer to the nth CaContent in this CaOmexManifest.
See also
getNumContents
Note
the caller owns the returned object and is responsible for deleting it.