libNuML 1.1.1
Library for reading / writing NuML documents
NUMLWriter.h File Reference
#include <numl/common/extern.h>
#include <numl/common/numlfwd.h>
#include <iosfwd>
#include <string>

Go to the source code of this file.

Classes

class  NUMLWriter
 Methods for writing NUML to files and text strings. More...
 

Functions

LIBNUML_CPP_NAMESPACE_END LIBNUML_CPP_NAMESPACE_BEGIN BEGIN_C_DECLS 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...
 

Function Documentation

◆ writeNUML()

LIBNUML_CPP_NAMESPACE_END LIBNUML_CPP_NAMESPACE_BEGIN BEGIN_C_DECLS 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);

Returns
non-zero on success and zero if the filename could not be opened for writing.

◆ writeNUMLToString()

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);

Returns
the string on success and NULL if one of the underlying parser components fail (rare).