KiCad PCB EDA Suite
xnode.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef XNODE_H_
26#define XNODE_H_
27
28#include <richio.h>
29
30// quiet the deprecated warnings with 3 lines:
31#include <wx/defs.h>
32#undef wxDEPRECATED
33#define wxDEPRECATED(x) x
34
35#include <wx/xml/xml.h>
36
37
43class XNODE : public wxXmlNode
44{
45public:
47 wxXmlNode()
48 {
49 }
50
51 XNODE( wxXmlNodeType aType, const wxString& aName, const wxString& aContent = wxEmptyString ) :
52 wxXmlNode( nullptr, aType, aName, aContent )
53 {
54 }
55
56 XNODE( XNODE* aParent, wxXmlNodeType aType, const wxString& aName,
57 const wxString& aContent = wxEmptyString, wxXmlAttribute* aProperties = nullptr ) :
58 wxXmlNode( aParent, aType, aName, aContent, aProperties )
59 {
60 }
61
63 {
64 return (XNODE* )wxXmlNode::GetChildren();
65 }
66
67 XNODE* GetNext() const
68 {
69 return (XNODE* )wxXmlNode::GetNext();
70 }
71
73 {
74 return (XNODE* )wxXmlNode::GetParent();
75 }
76
84 virtual void Format( OUTPUTFORMATTER* out, int nestLevel );
85
95 virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel );
96
97};
98
99#endif // XNODE_H_
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:310
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetParent() const
Definition: xnode.h:72
XNODE(wxXmlNodeType aType, const wxString &aName, const wxString &aContent=wxEmptyString)
Definition: xnode.h:51
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
XNODE()
Definition: xnode.h:46
XNODE(XNODE *aParent, wxXmlNodeType aType, const wxString &aName, const wxString &aContent=wxEmptyString, wxXmlAttribute *aProperties=nullptr)
Definition: xnode.h:56
virtual void FormatContents(OUTPUTFORMATTER *out, int nestLevel)
Write the contents of object as UTF8 out to an OUTPUTFORMATTER as an S-expression.
Definition: xnode.cpp:51
virtual void Format(OUTPUTFORMATTER *out, int nestLevel)
Write this object as UTF8 out to an OUTPUTFORMATTER as an S-expression.
Definition: xnode.cpp:32