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

Public Member Functions

 OmexDescription ()
 constructs a new omex description More...
 
 OmexDescription (XMLInputStream &stream)
 constructs a new omex description document from XML stream More...
 
bool isEmpty () const
 
std::string getDescription () const
 
void setDescription (const std::string &description)
 sets the description More...
 
std::string getAbout () const
 
void setAbout (const std::string &about)
 Sets the about element of the description. More...
 
const std::vector< VCard > & getCreators () const
 
std::vector< VCard > & getCreators ()
 
size_t getNumCreators () const
 
void setCreators (const std::vector< VCard > &creators)
 sets the creators More...
 
void addCreator (const VCard &creator)
 adds another creator to the list More...
 
LIBSBML_CPP_NAMESPACE_QUALIFIER const Date & getCreated () const
 
LIBSBML_CPP_NAMESPACE_QUALIFIER Date & getCreated ()
 
VCard getCreator (unsigned int index) const
 returns the creator for the given index, if not found an empty vcard will be returned. More...
 
void setCreated (const LIBSBML_CPP_NAMESPACE_QUALIFIER Date &created)
 Sets the creation date. More...
 
const std::vector< LIBSBML_CPP_NAMESPACE_QUALIFIER Date > & getModified () const
 
std::vector< LIBSBML_CPP_NAMESPACE_QUALIFIER Date > & getModified ()
 
LIBSBML_CPP_NAMESPACE_QUALIFIER Date getModified (int index) const
 
size_t getNumModified () const
 
void setModified (const std::vector< LIBSBML_CPP_NAMESPACE_QUALIFIER Date > &modified)
 sets the modification dates to the given vector More...
 
void addModification (const LIBSBML_CPP_NAMESPACE_QUALIFIER Date &date)
 Adds the given modification date to the vector. More...
 
void writeToFile (const std::string &fileName)
 writes this description to the given filename More...
 
std::string toXML (bool omitDeclaration=false)
 returns this omex description as a string More...
 

Static Public Member Functions

static const std::string & getRdfNS ()
 
static const std::string & getDcNS ()
 
static std::vector< OmexDescriptionparseFile (const std::string &fileName)
 parses the given filename returning all description documents found More...
 
static std::vector< OmexDescriptionparseString (const std::string &xml)
 parses the given filename returning all description documents found More...
 
static std::vector< OmexDescriptionreadFrom (XMLInputStream &stream)
 reads all the omes descriptions from the xml input stream More...
 
static LIBSBML_CPP_NAMESPACE_QUALIFIER Date getCurrentDateAndTime ()
 

Static Protected Member Functions

static std::string readString (XMLInputStream &stream)
 reads the text node from the next element and returns it More...
 
static LIBSBML_CPP_NAMESPACE_QUALIFIER Date readDate (XMLInputStream &stream)
 reads a date from the stream More...
 

Protected Attributes

std::string mDescription
 a text description element, that contains a description for the element referenced in the 'about' field. More...
 
std::string mAbout
 the about element indicating for which element this description is More...
 
std::vector< VCardmCreators
 a vector of creators More...
 
LIBSBML_CPP_NAMESPACE_QUALIFIER Date mCreated
 creation date More...
 
std::vector< LIBSBML_CPP_NAMESPACE_QUALIFIER Date > mModified
 a vector of modification dates More...
 

Constructor & Destructor Documentation

§ OmexDescription() [1/2]

OmexDescription::OmexDescription ( )

constructs a new omex description

§ OmexDescription() [2/2]

OmexDescription::OmexDescription ( XMLInputStream &  stream)

constructs a new omex description document from XML stream

Parameters
streamthe xml stream

Member Function Documentation

§ addCreator()

void OmexDescription::addCreator ( const VCard creator)

adds another creator to the list

Parameters
creatorthe creator to add

§ addModification()

void OmexDescription::addModification ( const LIBSBML_CPP_NAMESPACE_QUALIFIER Date &  date)

Adds the given modification date to the vector.

Parameters
datethe date to add

§ getAbout()

std::string OmexDescription::getAbout ( ) const
Returns
the about element

§ getCreated() [1/2]

LIBSBML_CPP_NAMESPACE_QUALIFIER const Date& OmexDescription::getCreated ( ) const
Returns
the creation date

§ getCreated() [2/2]

LIBSBML_CPP_NAMESPACE_QUALIFIER Date& OmexDescription::getCreated ( )
Returns
the creation date

§ getCreator()

VCard OmexDescription::getCreator ( unsigned int  index) const

returns the creator for the given index, if not found an empty vcard will be returned.

Parameters
indexthe index for the creator
Returns
the creator if found, will be empty otherwise

§ getCreators() [1/2]

const std::vector<VCard>& OmexDescription::getCreators ( ) const
Returns
a reference to all creators

§ getCreators() [2/2]

std::vector<VCard>& OmexDescription::getCreators ( )
Returns
a reference to all creators

§ getCurrentDateAndTime()

static LIBSBML_CPP_NAMESPACE_QUALIFIER Date OmexDescription::getCurrentDateAndTime ( )
static
Returns
the current date and time as Date object (in UTC)

§ getDcNS()

static const std::string& OmexDescription::getDcNS ( )
static
Returns
dublin core namespace

§ getDescription()

std::string OmexDescription::getDescription ( ) const
Returns
the description

§ getModified() [1/3]

const std::vector<LIBSBML_CPP_NAMESPACE_QUALIFIER Date>& OmexDescription::getModified ( ) const
Returns
the vector of all modification dates

§ getModified() [2/3]

std::vector<LIBSBML_CPP_NAMESPACE_QUALIFIER Date>& OmexDescription::getModified ( )
Returns
the vector of all modification dates

§ getModified() [3/3]

LIBSBML_CPP_NAMESPACE_QUALIFIER Date OmexDescription::getModified ( int  index) const
Returns
the modification date with the given index

§ getNumCreators()

size_t OmexDescription::getNumCreators ( ) const
Returns
the number of creators

§ getNumModified()

size_t OmexDescription::getNumModified ( ) const
Returns
number of modification dates

§ getRdfNS()

static const std::string& OmexDescription::getRdfNS ( )
static
Returns
RDF namespace

§ isEmpty()

bool OmexDescription::isEmpty ( ) const
Returns
an indication whether this description is empty

§ parseFile()

static std::vector<OmexDescription> OmexDescription::parseFile ( const std::string &  fileName)
static

parses the given filename returning all description documents found

Parameters
fileNamethe file to read from
Returns
std::vector of all descriptions in the file

§ parseString()

static std::vector<OmexDescription> OmexDescription::parseString ( const std::string &  xml)
static

parses the given filename returning all description documents found

Parameters
xmla string containing one or more omex descriptions
Returns
std::vector of all descriptions in the string

§ readDate()

static LIBSBML_CPP_NAMESPACE_QUALIFIER Date OmexDescription::readDate ( XMLInputStream &  stream)
staticprotected

reads a date from the stream

Parameters
streamthe stream to read from, a date will only be found if the next element is a start element with name "W3CDTF"
Returns
the date found (or a default date)

§ readFrom()

static std::vector<OmexDescription> OmexDescription::readFrom ( XMLInputStream &  stream)
static

reads all the omes descriptions from the xml input stream

Parameters
streamthe xml input stream
Returns

§ readString()

static std::string OmexDescription::readString ( XMLInputStream &  stream)
staticprotected

reads the text node from the next element and returns it

Parameters
streamthe stream to read from
Returns
the contents of the next text node

§ setAbout()

void OmexDescription::setAbout ( const std::string &  about)

Sets the about element of the description.

Parameters
aboutthe value to set

§ setCreated()

void OmexDescription::setCreated ( const LIBSBML_CPP_NAMESPACE_QUALIFIER Date &  created)

Sets the creation date.

Parameters
createdthe date to set

§ setCreators()

void OmexDescription::setCreators ( const std::vector< VCard > &  creators)

sets the creators

Parameters
creatorsthe vector of elements to set

§ setDescription()

void OmexDescription::setDescription ( const std::string &  description)

sets the description

Parameters
descriptionthe description element (without any xml tags)

§ setModified()

void OmexDescription::setModified ( const std::vector< LIBSBML_CPP_NAMESPACE_QUALIFIER Date > &  modified)

sets the modification dates to the given vector

Parameters
modifiedthe modification dates to set

§ toXML()

std::string OmexDescription::toXML ( bool  omitDeclaration = false)

returns this omex description as a string

Parameters
omitDeclarationoptional boolean flag indicating that the xml declaration should be omitted (false if omitted)
Returns
xml string representation of this description

§ writeToFile()

void OmexDescription::writeToFile ( const std::string &  fileName)

writes this description to the given filename

Parameters
fileNamethe file name to write to

Field Documentation

§ mAbout

std::string OmexDescription::mAbout
protected

the about element indicating for which element this description is

§ mCreated

LIBSBML_CPP_NAMESPACE_QUALIFIER Date OmexDescription::mCreated
protected

creation date

§ mCreators

std::vector<VCard> OmexDescription::mCreators
protected

a vector of creators

§ mDescription

std::string OmexDescription::mDescription
protected

a text description element, that contains a description for the element referenced in the 'about' field.

This description is expected to be in xhtml or plain text.

§ mModified

std::vector<LIBSBML_CPP_NAMESPACE_QUALIFIER Date> OmexDescription::mModified
protected

a vector of modification dates