libNuML  1.1.1
Library for reading / writing NuML documents
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 
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
46 
47 class NUMLDocument;
48 
49 
51 {
52 public:
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 
224 
225 #endif /* __cplusplus */
226 
227 
230 
231 
232 #ifndef SWIG
233 
234 
239 NUMLWriter_t *
240 NUMLWriter_create (void);
241 
246 void
248 
259 int
260 NUMLWriter_setProgramName (NUMLWriter_t *sw, const char *name);
261 
272 int
273 NUMLWriter_setProgramVersion (NUMLWriter_t *sw, const char *version);
274 
308 int
310  const NUMLDocument_t *d,
311  const char *filename );
312 
322 char *
324 
325 
333 int
335 
336 
344 int
346 
347 #endif /* !SWIG */
348 
349 
360 int
361 writeNUML (const NUMLDocument_t *d, const char *filename);
362 
363 
376 char *
378 
379 
382 
383 #endif /* NUMLWriter_h */
LIBNUML_EXTERN void NUMLWriter_free(NUMLWriter_t *sw)
Frees the given NUMLWriter.
Definition: NUMLWriter.cpp:298
#define BEGIN_C_DECLS
Definition: extern.h:112
#define LIBNUML_CPP_NAMESPACE_BEGIN
Definition: libnuml-namespace.h:71
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
std::string mProgramVersion
Definition: NUMLWriter.h:219
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_setProgramName(NUMLWriter_t *sw, const char *name)
Sets the name of this program.
Definition: NUMLWriter.cpp:321
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
LIBNUML_EXTERN NUMLWriter_t * NUMLWriter_create()
Creates a new NUMLWriter and returns a pointer to it.
Definition: NUMLWriter.cpp:287
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
This represents the numl document that contains all information.
Definition: NUMLDocument.h:106
#define LIBNUML_EXTERN
Begin svn Header.
Definition: extern.h:104
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
Methods for writing NUML to files and text strings.
Definition: NUMLWriter.h:50
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
CLASS_OR_STRUCT NUMLWriter NUMLWriter_t
Methods for writing NUML to files and text strings.
Definition: numlfwd.h:184
#define END_C_DECLS
Definition: extern.h:113
LIBNUML_EXTERN int NUMLWriter_setProgramVersion(NUMLWriter_t *sw, const char *version)
Sets the version of this program.
Definition: NUMLWriter.cpp:344
#define LIBNUML_CPP_NAMESPACE_END
Definition: libnuml-namespace.h:72
CLASS_OR_STRUCT NUMLDocument NUMLDocument_t
This represents the numl document that contains all information.
Definition: numlfwd.h:88
std::string mProgramName
Definition: NUMLWriter.h:218