nidas v1.2.3
XMLWriter.h
Go to the documentation of this file.
1// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2// vim: set shiftwidth=4 softtabstop=4 expandtab:
3/*
4 ********************************************************************
5 ** NIDAS: NCAR In-situ Data Acquistion Software
6 **
7 ** 2006, Copyright University Corporation for Atmospheric Research
8 **
9 ** This program is free software; you can redistribute it and/or modify
10 ** it under the terms of the GNU General Public License as published by
11 ** the Free Software Foundation; either version 2 of the License, or
12 ** (at your option) any later version.
13 **
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ** GNU General Public License for more details.
18 **
19 ** The LICENSE.txt file accompanying this software contains
20 ** a copy of the GNU General Public License. If it is not found,
21 ** write to the Free Software Foundation, Inc.,
22 ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 **
24 ********************************************************************
25*/
26
27#ifndef NIDAS_CORE_XMLWRITER_H
28#define NIDAS_CORE_XMLWRITER_H
29
30#include "XMLParser.h"
31
32#include <string>
33
34namespace nidas { namespace core {
35
39class XMLWriter {
40public:
41
47 XMLWriter();
48
53 virtual ~XMLWriter();
54
63 void setDiscardDefaultContent(bool val);
64
74 void setEntities(bool val);
75
83 void setCanonicalForm(bool val);
84
92 void setPrettyPrint(bool val);
93
101 void setNormalizeCharacters(bool val);
102
112 void setSplitCDATASections(bool val);
113
122 void setValidation(bool val);
123
133 void setWhitespaceInElement(bool val);
134
142 void setXMLDeclaration(bool val);
143
144 void setFilter(xercesc::DOMLSSerializerFilter* filter);
145
149 virtual void write(xercesc::DOMDocument*doc, const std::string& fileName);
150
155 virtual void writeNode(xercesc::DOMLSOutput* const dest,
156 const xercesc::DOMNode& node);
157
158private:
159
160 xercesc::DOMImplementation *_impl;
161
162 xercesc::DOMLSSerializer *_writer;
163
165
168
171
172};
173
174}} // namespace nidas namespace core
175
176#endif
177
Definition XMLParser.h:62
Wrapper class around xerces-c DOMWriter to write XML.
Definition XMLWriter.h:39
xercesc::DOMLSSerializer * _writer
Definition XMLWriter.h:162
void setPrettyPrint(bool val)
Format pretty-print.
Definition XMLWriter.cc:76
void setWhitespaceInElement(bool val)
Whitespace in element content.
Definition XMLWriter.cc:96
void setValidation(bool val)
Validation.
Definition XMLWriter.cc:91
virtual void write(xercesc::DOMDocument *doc, const std::string &fileName)
Definition XMLWriter.cc:112
XMLWriter()
Constructor.
Definition XMLWriter.cc:39
XMLWriter(const XMLWriter &)
No copying.
void setXMLDeclaration(bool val)
Include xml declaration.
XMLErrorHandler _errorHandler
Definition XMLWriter.h:164
void setSplitCDATASections(bool val)
Split CDATA sections.
Definition XMLWriter.cc:86
void setEntities(bool val)
Control writing of entities.
Definition XMLWriter.cc:66
void setFilter(xercesc::DOMLSSerializerFilter *filter)
Definition XMLWriter.cc:56
virtual ~XMLWriter()
Nuke the XMLWriter.
Definition XMLWriter.cc:48
xercesc::DOMImplementation * _impl
Definition XMLWriter.h:160
void setCanonicalForm(bool val)
Canonicalize the output.
Definition XMLWriter.cc:71
XMLWriter & operator=(const XMLWriter &)
No assignment.
virtual void writeNode(xercesc::DOMLSOutput *const dest, const xercesc::DOMNode &node)
Definition XMLWriter.cc:101
void setNormalizeCharacters(bool val)
Normalize characters.
Definition XMLWriter.cc:81
void setDiscardDefaultContent(bool val)
Discard default content.
Definition XMLWriter.cc:61
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31