libNuML 1.1.1
Library for reading / writing NuML documents
Loading...
Searching...
No Matches
NUMLWriter.h
Go to the documentation of this file.
1/*
2* ****************************************************************************
3* This file is part of libNUML. Please visit http://code.google.com/p/numl/for more
4* information about NUML, and the latest version of libNUML.
5* Copyright (c) 2013 The University of Manchester.
6*
7* This library is free software; you can redistribute it and/or modify it
8* under the terms of the GNU Lesser General Public License as published
9* by the Free Software Foundation. A copy of the license agreement is
10* provided in the file named "LICENSE.txt" included with this software
11* distribution and also available online as http://www.gnu.org/licenses/lgpl.html
12*
13* Contributors:
14* Joseph O. Dada, The University of Manchester - initial API and implementation
15* ****************************************************************************
16*
17*/
18
29
30#ifndef NUMLWriter_h
31#define NUMLWriter_h
32
33
34#include <numl/common/extern.h>
35#include <numl/common/numlfwd.h>
36
37
38
39
40
41#include <iosfwd>
42#include <string>
43
44#ifdef __cplusplus
45LIBNUML_CPP_NAMESPACE_BEGIN
46
47class NUMLDocument;
48
49
51{
52public:
53
57 NUMLWriter ();
58
59
63 ~NUMLWriter ();
64
65
89 int setProgramName (const std::string& name);
90
91
115 int setProgramVersion (const std::string& version);
116
117
155 bool writeNUML (const NUMLDocument* d, const std::string& filename);
156
157
168 bool writeNUML (const NUMLDocument* d, std::ostream& stream);
169
170
183 char* writeToString (const NUMLDocument* d);
184
185
198 static bool hasZlib();
199
200
213 static bool hasBzip2();
214
215
216 protected:
217
218 std::string mProgramName;
219 std::string mProgramVersion;
220
221};
222
223LIBNUML_CPP_NAMESPACE_END
224
225#endif /* __cplusplus */
226
227
228LIBNUML_CPP_NAMESPACE_BEGIN
230
231
232#ifndef SWIG
233
234
240NUMLWriter_create (void);
241
246void
248
259int
260NUMLWriter_setProgramName (NUMLWriter_t *sw, const char *name);
261
272int
273NUMLWriter_setProgramVersion (NUMLWriter_t *sw, const char *version);
274
308int
310 const NUMLDocument_t *d,
311 const char *filename );
312
322char *
324
325
333int
335
336
344int
346
347#endif /* !SWIG */
348
349
360int
361writeNUML (const NUMLDocument_t *d, const char *filename);
362
363
376char *
378
379
381LIBNUML_CPP_NAMESPACE_END
382
383#endif /* NUMLWriter_h */
LIBNUML_EXTERN int NUMLWriter_hasBzip2()
Predicate returning non-zero or zero depending on whether libNUML is linked with bzip2 at compile tim...
Definition NUMLWriter.cpp:422
LIBNUML_EXTERN void NUMLWriter_free(NUMLWriter_t *sw)
Frees the given NUMLWriter.
Definition NUMLWriter.cpp:298
LIBNUML_EXTERN int NUMLWriter_hasZlib()
Predicate returning non-zero or zero depending on whether libNUML is linked with zlib at compile time...
Definition NUMLWriter.cpp:408
LIBNUML_EXTERN int NUMLWriter_writeNUML(NUMLWriter_t *sw, const NUMLDocument_t *d, const char *filename)
Writes the given NUML document to filename.
Definition NUMLWriter.cpp:376
LIBNUML_EXTERN NUMLWriter_t * NUMLWriter_create()
Creates a new NUMLWriter and returns a pointer to it.
Definition NUMLWriter.cpp:287
LIBNUML_EXTERN int NUMLWriter_setProgramName(NUMLWriter_t *sw, const char *name)
Sets the name of this program.
Definition NUMLWriter.cpp:321
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.
Definition NUMLWriter.cpp:394
LIBNUML_EXTERN int writeNUML(const NUMLDocument_t *d, const char *filename)
Writes the given NUML document to filename.
Definition NUMLWriter.cpp:439
LIBNUML_EXTERN int NUMLWriter_setProgramVersion(NUMLWriter_t *sw, const char *version)
Sets the version of this program.
Definition NUMLWriter.cpp:344
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.
Definition NUMLWriter.cpp:439
LIBNUML_EXTERN char * writeNUMLToString(const NUMLDocument_t *d)
Writes the given NUML document to an in-memory string and returns a pointer to it.
Definition NUMLWriter.cpp:459
This represents the numl document that contains all information.
Definition NUMLDocument.h:107
std::string mProgramVersion
Definition NUMLWriter.h:219
static bool hasZlib()
Predicate returning true or false depending on whether underlying libNUML is linked with zlib.
Definition NUMLWriter.cpp:262
static bool hasBzip2()
Predicate returning true or false depending on whether underlying libNUML is linked with bzip2.
Definition NUMLWriter.cpp:275
int setProgramVersion(const std::string &version)
Definition NUMLWriter.cpp:82
int setProgramName(const std::string &name)
Definition NUMLWriter.cpp:65
NUMLWriter()
Creates a new NUMLWriter.
Definition NUMLWriter.cpp:42
char * writeToString(const NUMLDocument *d)
Writes the given NUML document to an in-memory string and returns a pointer to it.
Definition NUMLWriter.cpp:246
std::string mProgramName
Definition NUMLWriter.h:218
#define BEGIN_C_DECLS
Definition extern.h:112
#define LIBNUML_EXTERN
Begin svn Header.
Definition extern.h:104
#define END_C_DECLS
Definition extern.h:113
CLASS_OR_STRUCT NUMLDocument NUMLDocument_t
This represents the numl document that contains all information.
Definition numlfwd.h:88
CLASS_OR_STRUCT NUMLWriter NUMLWriter_t
Methods for writing NUML to files and text strings.
Definition numlfwd.h:184