libSBML C++ API
5.20.4
|
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. It is a class used in the implementation of extra functionality provided by libSBML.
In SBML, resolvers come into play with the SBML Level 3 Hierarchical Model Composition package (“comp”); this package includes features that allow a model to be composed from pieces that are external to a given SBML document, which implies the need to be able to identify and locate those external pieces. The identifiers used in “comp” are URIs (Uniform Resource Identifiers).
SBMLFileResolver is a class implementing the ability to resolve URIs to files. It works on the local file system only. It can resolve relative and absolute paths, and directories to be searched can be specified using the methods SBMLFileResolver::setAdditionalDirs(), SBMLFileResolver::addAdditionalDir() and SBMLFileResolver::clearAdditionalDirs().
Public Member Functions | |
virtual void | addAdditionalDir (const std::string &dir) |
Adds a directory to the list of directories to search for files to resolve. More... | |
virtual void | clearAdditionalDirs () |
Removes the list of directories to search for files to resolve. More... | |
virtual SBMLFileResolver * | clone () const |
Creates and returns a deep copy of this SBMLFileResolver object. More... | |
SBMLFileResolver & | operator= (const SBMLFileResolver &rhs) |
Assignment operator for SBMLFileResolver. More... | |
virtual SBMLDocument * | resolve (const std::string &uri, const std::string &baseUri="") const |
Resolves the document for the given URI. More... | |
virtual SBMLUri * | resolveUri (const std::string &uri, const std::string &baseUri="") const |
Resolves the full URI for a given URI without actually reading the document. More... | |
SBMLFileResolver () | |
Creates a new SBMLFileResolver object. More... | |
SBMLFileResolver (const SBMLFileResolver &c) | |
Copy constructor. More... | |
virtual void | setAdditionalDirs (const std::vector< std::string > &dirs) |
Sets the list of directories in which to search for files to resolve. More... | |
virtual | ~SBMLFileResolver () |
Destroy this SBMLFileResolver object. More... | |
SBMLFileResolver::SBMLFileResolver | ( | ) |
Creates a new SBMLFileResolver object.
SBMLFileResolver::SBMLFileResolver | ( | const SBMLFileResolver & | c | ) |
Copy constructor.
Creates a copy of an SBMLFileResolver object.
c | the SBMLFileResolver object to copy. |
|
virtual |
Destroy this SBMLFileResolver object.
|
virtual |
Adds a directory to the list of directories to search for files to resolve.
dir | the directory to add. |
|
virtual |
Removes the list of directories to search for files to resolve.
After this method is called, SBMLFileResolver::resolve(const std::string &uri, const std::string& baseUri) will only search absolute or relative directories. New directories can be added using SBMLFileResolver::addAdditionalDir() or setAdditionalDirs().
|
virtual |
Creates and returns a deep copy of this SBMLFileResolver object.
Reimplemented from SBMLResolver.
SBMLFileResolver & SBMLFileResolver::operator= | ( | const SBMLFileResolver & | rhs | ) |
Assignment operator for SBMLFileResolver.
rhs | the object whose values are used as the basis of the assignment. |
|
virtual |
Resolves the document for the given URI.
uri | the URI to the target document. |
baseUri | base URI, in case the URI is a relative one. |
NULL
. Reimplemented from SBMLResolver.
|
virtual |
Resolves the full URI for a given URI without actually reading the document.
uri | the URI to the target document. |
baseUri | base URI, in case the URI is a relative one. |
NULL
. Reimplemented from SBMLResolver.
|
virtual |
Sets the list of directories in which to search for files to resolve.
Unlike the similar SBMLFileResolver::addAdditionalDir(), this method replaces any current list of search directories with the given list of dirs
.
dirs | a vector of strings which contain directories. |