1 #ifndef __XMLWRITER_H__
2 #define __XMLWRITER_H__
4 /**
5 * Phoebe DOM Implementation.
6 *
7 * This is a C++ approximation of the W3C DOM model, which follows
8 * fairly closely the specifications in the various .idl files, copies of
9 * which are provided for reference. Most important is this one:
10 *
11 * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
12 *
13 * Authors:
14 * Bob Jamison
15 *
16 * Copyright (C) 2005-2008 Bob Jamison
17 *
18 * This library is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU Lesser General Public
20 * License as published by the Free Software Foundation; either
21 * version 2.1 of the License, or (at your option) any later version.
22 *
23 * This library is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 * Lesser General Public License for more details.
27 *
28 * You should have received a copy of the GNU Lesser General Public
29 * License along with this library; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 */
34 #include "dom.h"
35 #include <stdio.h>
36 #include <glib.h>
39 namespace org
40 {
41 namespace w3c
42 {
43 namespace dom
44 {
48 class XmlWriter
49 {
50 public:
52 XmlWriter();
54 virtual ~XmlWriter();
57 void write(const NodePtr node);
59 void writeFile(FILE *f, const NodePtr node);
62 protected:
64 int indent;
66 void spaces();
68 void po(const char *str, ...) G_GNUC_PRINTF(2,3);
70 void pos(const DOMString &str);
72 DOMString buf;
75 };
78 } //namespace dom
79 } //namespace w3c
80 } //namespace org
88 #endif /* __XMLWRITER_H__ */