JEMRIS 2.9.2
open-source MRI simulations
Loading...
Searching...
No Matches
XMLIO.h
Go to the documentation of this file.
1
5/*
6 * JEMRIS Copyright (C)
7 * 2006-2025 Tony Stoecker
8 * 2007-2018 Kaveh Vahedipour
9 * 2009-2019 Daniel Pflugfelder
10 *
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27#ifndef XMLIO_H_
28#define XMLIO_H_
29
30#include <string.h>
31#include <stdlib.h>
32
33#include <xercesc/dom/DOM.hpp>
34#include <xercesc/parsers/XercesDOMParser.hpp>
35#include <xercesc/util/OutOfMemoryException.hpp>
36#include <xercesc/framework/LocalFileInputSource.hpp>
37
38XERCES_CPP_NAMESPACE_USE
39
40using namespace std;
41
43
58
60
61class XMLIO {
62
63 public:
64
68 XMLIO();
69
73 virtual ~XMLIO();
74
81 DOMDocument*
82 Parse (string uri);
83
92 DOMNode*
93 RunTree (DOMNode* node, void* ptr, unsigned int (*fun) (void*, DOMNode*) );
94
103 bool
104 Write (DOMImplementation* impl, DOMNode* node, string filename) ;
105
106 private:
107
108 XercesDOMParser::ValSchemes valScheme;
109 bool doNamespaces;
110 bool doSchema;
111 bool schemaFullChecking;
112 bool doCreate;
113
114 XercesDOMParser* m_parser;
115 DOMTreeErrorReporter* m_err_reporter;
116};
117
118#endif /*XMLIO_H_*/
errorCodes
Return codes.
Definition XMLIO.h:48
@ PARSER_OUT_OF_MEMORY_EXCEPTION
Definition XMLIO.h:51
@ OK
Definition XMLIO.h:49
@ EMPTY_DOCUMENT
Definition XMLIO.h:56
@ XML_PLATFORM_INIT
Definition XMLIO.h:50
@ NORMALIZE_DOM_EXCEPTION
Definition XMLIO.h:55
@ PARSER_XML_EXCEPTION
Definition XMLIO.h:52
@ PARSER_GENERAL_EXCEPTION
Definition XMLIO.h:54
@ PARSER_DOM_EXCEPTION
Definition XMLIO.h:53
XML file-IO class.
Definition XMLIO.h:61
DOMDocument * Parse(string uri)
Read in the XML file and return a DOM object.
Definition XMLIO.cpp:70
virtual ~XMLIO()
Destructor.
Definition XMLIO.cpp:33
bool Write(DOMImplementation *impl, DOMNode *node, string filename)
Write DOM node to file.
Definition XMLIO.cpp:177
XMLIO()
Constructor.
Definition XMLIO.cpp:41
DOMNode * RunTree(DOMNode *node, void *ptr, unsigned int(*fun)(void *, DOMNode *))
Recursive run through XML tree and do something.
Definition XMLIO.cpp:156

-- last change 03.01.2025 | Tony Stoecker | Imprint | Data Protection --