libNuML  1.1.1
Library for reading / writing NuML documents
NUMLNamespaces.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 
24 #ifndef NUMLNamespaces_h
25 #define NUMLNamespaces_h
26 
27 #include <numl/common/extern.h>
28 #include <sbml/xml/XMLNamespaces.h>
29 
30 #include <numl/common/common.h>
31 #include <numl/common/numlfwd.h>
32 
33 
34 
35 #ifdef __cplusplus
36 
37 
38 
39 LIBNUML_CPP_NAMESPACE_BEGIN
40 
41 const unsigned int NUML_DEFAULT_LEVEL = 1;
42 const unsigned int NUML_DEFAULT_VERSION = 1;
43 const char* const NUML_XMLNS_L1 = "http://www.numl.org/numl/level1/version1";
44 const char* const NUML_XMLNS_L1V1 = "http://www.numl.org/numl/level1/version1";
45 
47 {
48 public:
49 
84  NUMLNamespaces(unsigned int level = NUML_DEFAULT_LEVEL,
85  unsigned int version = NUML_DEFAULT_VERSION);
86 
87 
91  ~NUMLNamespaces();
92 
93 
99  NUMLNamespaces(const NUMLNamespaces& orig);
100 
101 
105  NUMLNamespaces& operator=(const NUMLNamespaces& orig);
106 
107 
113  NUMLNamespaces* clone () const;
114 
115 
126  static std::string getNUMLNamespaceURI(unsigned int level,
127  unsigned int version);
128 
129 
135  unsigned int getLevel();
136 
137 
138 
144  unsigned int getVersion();
145 
146 
147 
161  LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * getNamespaces();
162 
163 
170  void addNamespaces(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * xmlns);
171 
172 
173  void setLevel(unsigned int level);
174 
175 
176  void setVersion(unsigned int version);
177 
178 
179  void setNamespaces(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * xmlns);
180 
181 protected:
182 
183  unsigned int mLevel;
184  unsigned int mVersion;
185  LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * mNamespaces;
186 
187 };
188 
189 LIBNUML_CPP_NAMESPACE_END
190 
191 #endif /* __cplusplus */
192 
193 
194 #ifndef SWIG
195 
196 LIBNUML_CPP_NAMESPACE_BEGIN
198 
199 /*-----------------------------------------------------------------------------
200  * See the .cpp file for the documentation of the following functions.
201  *---------------------------------------------------------------------------*/
202 
205 NUMLNamespaces_create(unsigned int level, unsigned int version);
206 
207 
209 unsigned int
211 
212 
214 unsigned int
216 
217 
219 LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces_t *
221 
222 
224 const char *
225 NUMLNamespaces_getNUMLNamespaceURI(unsigned int level, unsigned int version);
226 
227 
229 void
231  LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces_t * xmlns);
232 
233 
235 LIBNUML_CPP_NAMESPACE_END
236 
237 #endif /* !SWIG */
238 #endif /* NUMLNamespaces_h */
numlfwd.h
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: extern.h:112
NUML_DEFAULT_LEVEL
const LIBNUML_CPP_NAMESPACE_BEGIN unsigned int NUML_DEFAULT_LEVEL
Definition: NUMLNamespaces.h:41
NUMLNamespaces_getNamespaces
LIBNUML_EXTERN LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces_t * NUMLNamespaces_getNamespaces(NUMLNamespaces_t *numlns)
Get the NUML Version of this NUMLNamespaces_t structure.
Definition: NUMLNamespaces.cpp:243
NUMLNamespaces::mVersion
unsigned int mVersion
Definition: NUMLNamespaces.h:184
NUMLNamespaces_create
LIBNUML_EXTERN NUMLNamespaces_t * NUMLNamespaces_create(unsigned int level, unsigned int version)
Creates a new NUMLNamespaces_t structure corresponding to the given NUML level and version.
Definition: NUMLNamespaces.cpp:198
extern.h
NUMLNamespaces
namespace class
Definition: NUMLNamespaces.h:46
NUML_XMLNS_L1V1
const char *const NUML_XMLNS_L1V1
Definition: NUMLNamespaces.h:44
LIBNUML_EXTERN
#define LIBNUML_EXTERN
Begin svn Header.
Definition: extern.h:104
NUMLNamespaces_getVersion
LIBNUML_EXTERN unsigned int NUMLNamespaces_getVersion(NUMLNamespaces_t *numlns)
Get the NUML Version of this NUMLNamespaces_t structure.
Definition: NUMLNamespaces.cpp:228
END_C_DECLS
#define END_C_DECLS
Definition: extern.h:113
NUML_DEFAULT_VERSION
const unsigned int NUML_DEFAULT_VERSION
Definition: NUMLNamespaces.h:42
NUMLNamespaces_getNUMLNamespaceURI
const LIBNUML_EXTERN char * NUMLNamespaces_getNUMLNamespaceURI(unsigned int level, unsigned int version)
Returns a string representing the NUML XML namespace for the given level and version of NUML.
Definition: NUMLNamespaces.cpp:261
NUMLNamespaces_getLevel
LIBNUML_EXTERN unsigned int NUMLNamespaces_getLevel(NUMLNamespaces_t *numlns)
Get the NUML Level of this NUMLNamespaces_t structure.
Definition: NUMLNamespaces.cpp:213
NUMLNamespaces_t
CLASS_OR_STRUCT NUMLNamespaces NUMLNamespaces_t
namespace class
Definition: numlfwd.h:196
common.h
NUMLNamespaces_addNamespaces
LIBNUML_EXTERN void NUMLNamespaces_addNamespaces(NUMLNamespaces_t *numlns, LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces_t *xmlns)
Add the XML namespaces list to the set of namespaces within this NUMLNamespaces_t structure.
Definition: NUMLNamespaces.cpp:276
XMLNamespaces_t
CLASS_OR_STRUCT XMLNamespaces XMLNamespaces_t
Definition: numlfwd.h:247
NUML_XMLNS_L1
const char *const NUML_XMLNS_L1
Definition: NUMLNamespaces.h:43
NUMLNamespaces::mLevel
unsigned int mLevel
Definition: NUMLNamespaces.h:183
NUMLNamespaces::mNamespaces
LIBSBML_CPP_NAMESPACE_QUALIFIER XMLNamespaces * mNamespaces
Definition: NUMLNamespaces.h:185