libSBML C++ API
libSBML 5.8.0 C++ API
|
Writes an SBML Document to file or in-memory string.
Functions | |
SBMLWriter_t * | SBMLWriter_create () |
Creates a new SBMLWriter and returns a pointer to it. More... | |
void | SBMLWriter_free (SBMLWriter_t *sw) |
Frees the given SBMLWriter. More... | |
int | SBMLWriter_hasBzip2 () |
Predicate returning non-zero or zero depending on whether libSBML is linked with bzip2 at compile time. More... | |
int | SBMLWriter_hasZlib () |
Predicate returning non-zero or zero depending on whether libSBML is linked with zlib at compile time. More... | |
int | SBMLWriter_setProgramName (SBMLWriter_t *sw, const char *name) |
Sets the name of this program. More... | |
int | SBMLWriter_setProgramVersion (SBMLWriter_t *sw, const char *version) |
Sets the version of this program. More... | |
int | SBMLWriter_writeSBML (SBMLWriter_t *sw, const SBMLDocument_t *d, const char *filename) |
Writes the given SBML document to filename. More... | |
int | SBMLWriter_writeSBMLToFile (SBMLWriter_t *sw, const SBMLDocument_t *d, const char *filename) |
Writes the given SBML document to filename. More... | |
char * | SBMLWriter_writeSBMLToString (SBMLWriter_t *sw, const SBMLDocument_t *d) |
Writes the given SBML document to an in-memory string and returns a pointer to it. More... | |
int | writeSBML (const SBMLDocument_t *d, const char *filename) |
Writes the given SBML document to filename. More... | |
int | writeSBMLToFile (const SBMLDocument_t *d, const char *filename) |
Writes the given SBML document to filename. More... | |
char * | writeSBMLToString (const SBMLDocument_t *d) |
Writes the given SBML document to an in-memory string and returns a pointer to it. More... | |
SBMLWriter_t* SBMLWriter_create | ( | ) |
Creates a new SBMLWriter and returns a pointer to it.
void SBMLWriter_free | ( | SBMLWriter_t * | sw | ) |
Frees the given SBMLWriter.
int SBMLWriter_hasBzip2 | ( | ) |
Predicate returning non-zero
or zero
depending on whether libSBML is linked with bzip2 at compile time.
non-zero
if bzip2 is linked, zero
otherwise. int SBMLWriter_hasZlib | ( | ) |
Predicate returning non-zero
or zero
depending on whether libSBML is linked with zlib at compile time.
non-zero
if zlib is linked, zero
otherwise. int SBMLWriter_setProgramName | ( | SBMLWriter_t * | sw, |
const char * | name | ||
) |
Sets the name of this program.
i. e. the one about to write out the SBMLDocument. If the program name and version are set (setProgramVersion()), the following XML comment, intended for human consumption, will be written at the beginning of the document:
int SBMLWriter_setProgramVersion | ( | SBMLWriter_t * | sw, |
const char * | version | ||
) |
Sets the version of this program.
i. e. the one about to write out the SBMLDocument. If the program version and name are set (setProgramName()), the following XML comment, intended for human consumption, will be written at the beginning of the document:
int SBMLWriter_writeSBML | ( | SBMLWriter_t * | sw, |
const SBMLDocument_t * | d, | ||
const char * | filename | ||
) |
Writes the given SBML document to filename.
If the filename ends with .gz, the file will be compressed by gzip. Similary, if the filename ends with .zip or .bz2, the file will be compressed by zip or bzip2, respectively. Otherwise, the fill will be uncompressed. If the filename ends with .zip, a filename that will be added to the zip archive file will end with .xml or .sbml. For example, the filename in the zip archive will be test.xml if the given filename is test.xml.zip or test.zip. Also, the filename in the archive will be test.sbml if the given filename is test.sbml.zip.
zero
will be returned if a compressed file name is given and libSBML is not linked with the required library. SBMLWriter_hasZlib() and SBMLWriter_hasBzip2() can be used to check whether libSBML was linked with the library at compile time.int SBMLWriter_writeSBMLToFile | ( | SBMLWriter_t * | sw, |
const SBMLDocument_t * | d, | ||
const char * | filename | ||
) |
Writes the given SBML document to filename.
If the filename ends with .gz, the file will be compressed by gzip. Similary, if the filename ends with .zip or .bz2, the file will be compressed by zip or bzip2, respectively. Otherwise, the fill will be uncompressed. If the filename ends with .zip, a filename that will be added to the zip archive file will end with .xml or .sbml. For example, the filename in the zip archive will be test.xml if the given filename is test.xml.zip or test.zip. Also, the filename in the archive will be test.sbml if the given filename is test.sbml.zip.
zero
will be returned if a compressed file name is given and libSBML is not linked with the required library. SBMLWriter_hasZlib() and SBMLWriter_hasBzip2() can be used to check whether libSBML was linked with the library at compile time.char* SBMLWriter_writeSBMLToString | ( | SBMLWriter_t * | sw, |
const SBMLDocument_t * | d | ||
) |
Writes the given SBML document to an in-memory string and returns a pointer to it.
The string is owned by the caller and should be freed (with free()) when no longer needed.
int writeSBML | ( | const SBMLDocument_t * | d, |
const char * | filename | ||
) |
Writes the given SBML document to filename.
Writes the given SBML document d
to the file named by filename
.
This convenience function is functionally equivalent to:
SBMLWriter_writeSBML(SBMLWriter_create(), d, filename);
int writeSBMLToFile | ( | const SBMLDocument_t * | d, |
const char * | filename | ||
) |
Writes the given SBML document to filename.
Writes the given SBML document d
to the file filename
.
This convenience function is functionally equivalent to:
SBMLWriter_writeSBMLToFile(SBMLWriter_create(), d, filename);
char* writeSBMLToString | ( | const SBMLDocument_t * | d | ) |
Writes the given SBML document to an in-memory string and returns a pointer to it.
Writes the given SBML document d
to an in-memory string and returns the string.
The string is owned by the caller and should be freed (with free()) when no longer needed. This convenience function is functionally equivalent to:
SBMLWriter_writeSBMLToString(SBMLWriter_create(), d);