libNuML 1.1.1
Library for reading / writing NuML documents
|
#include <ios>
#include <iostream>
#include <fstream>
#include <sstream>
#include <numl/common/common.h>
#include <sbml/xml/XMLOutputStream.h>
#include <numl/NUMLError.h>
#include <numl/NUMLDocument.h>
#include <numl/NUMLWriter.h>
#include <numl/common/operationReturnValues.h>
#include <sbml/compress/CompressCommon.h>
#include <sbml/compress/OutputCompressor.h>
#include <sbml/SBMLWriter.h>
Functions | |
LIBNUML_EXTERN NUMLWriter_t * | NUMLWriter_create () |
Creates a new NUMLWriter and returns a pointer to it. More... | |
LIBNUML_EXTERN void | NUMLWriter_free (NUMLWriter_t *sw) |
Frees the given NUMLWriter. More... | |
LIBNUML_EXTERN int | NUMLWriter_setProgramName (NUMLWriter_t *sw, const char *name) |
Sets the name of this program. More... | |
LIBNUML_EXTERN int | NUMLWriter_setProgramVersion (NUMLWriter_t *sw, const char *version) |
Sets the version of this program. More... | |
LIBNUML_EXTERN int | NUMLWriter_writeNUML (NUMLWriter_t *sw, const NUMLDocument_t *d, const char *filename) |
Writes the given NUML document to filename. More... | |
LIBNUML_EXTERN char * | NUMLWriter_writeNUMLToString (NUMLWriter_t *sw, const NUMLDocument_t *d) |
Writes the given NUML document to an in-memory string and returns a pointer to it. More... | |
LIBNUML_EXTERN int | NUMLWriter_hasZlib () |
Predicate returning non-zero or zero depending on whether libNUML is linked with zlib at compile time. More... | |
LIBNUML_EXTERN int | NUMLWriter_hasBzip2 () |
Predicate returning non-zero or zero depending on whether libNUML is linked with bzip2 at compile time. More... | |
LIBNUML_EXTERN int | writeNUML (const NUMLDocument_t *d, const char *filename) |
Writes the given NUML document to filename. More... | |
LIBNUML_EXTERN char * | writeNUMLToString (const NUMLDocument_t *d) |
Writes the given NUML document to an in-memory string and returns a pointer to it. More... | |
LIBNUML_EXTERN NUMLWriter_t * NUMLWriter_create | ( | ) |
Creates a new NUMLWriter and returns a pointer to it.
LIBNUML_EXTERN void NUMLWriter_free | ( | NUMLWriter_t * | sw | ) |
Frees the given NUMLWriter.
LIBNUML_EXTERN int NUMLWriter_hasBzip2 | ( | ) |
Predicate returning non-zero
or zero
depending on whether libNUML is linked with bzip2 at compile time.
non-zero
if bzip2 is linked, zero
otherwise. LIBNUML_EXTERN int NUMLWriter_hasZlib | ( | ) |
Predicate returning non-zero
or zero
depending on whether libNUML is linked with zlib at compile time.
non-zero
if zlib is linked, zero
otherwise. LIBNUML_EXTERN int NUMLWriter_setProgramName | ( | NUMLWriter_t * | sw, |
const char * | name | ||
) |
Sets the name of this program.
i. e. the one about to write out the NUMLDocument. 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:
LIBNUML_EXTERN int NUMLWriter_setProgramVersion | ( | NUMLWriter_t * | sw, |
const char * | version | ||
) |
Sets the version of this program.
i. e. the one about to write out the NUMLDocument. 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:
LIBNUML_EXTERN int NUMLWriter_writeNUML | ( | NUMLWriter_t * | sw, |
const NUMLDocument_t * | d, | ||
const char * | filename | ||
) |
Writes the given NUML 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 .numl. 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.numl if the given filename is test.numl.zip.
zero
will be returned if a compressed file name is given and libNUML is not linked with the required library. NUMLWriter_hasZlib() and NUMLWriter_hasBzip2() can be used to check whether libNUML was linked with the library at compile time.LIBNUML_EXTERN char * NUMLWriter_writeNUMLToString | ( | NUMLWriter_t * | sw, |
const NUMLDocument_t * | d | ||
) |
Writes the given NUML 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.
LIBNUML_EXTERN int writeNUML | ( | const NUMLDocument_t * | d, |
const char * | filename | ||
) |
Writes the given NUML document to filename.
This convenience function is functionally equivalent to:
NUMLWriter_writeNUML(NUMLWriter_create(), d, filename);
LIBNUML_EXTERN char * writeNUMLToString | ( | const NUMLDocument_t * | d | ) |
Writes the given NUML 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. This convenience function is functionally equivalent to:
NUMLWriter_writeNUMLToString(NUMLWriter_create(), d);