KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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// quiet the deprecated warnings with 3 lines:
29#include <wx/defs.h>
30#undef wxDEPRECATED
31#define wxDEPRECATED(x) x
32
33#include <wx/xml/xml.h>
34
35class OUTPUTFORMATTER;
36
42class XNODE : public wxXmlNode
43{
44public:
46 wxXmlNode()
47 {
48 }
49
50 XNODE( wxXmlNodeType aType, const wxString& aName, const wxString& aContent = wxEmptyString ) :
51 wxXmlNode( nullptr, aType, aName, aContent )
52 {
53 }
54
55 XNODE( XNODE* aParent, wxXmlNodeType aType, const wxString& aName,
56 const wxString& aContent = wxEmptyString, wxXmlAttribute* aProperties = nullptr ) :
57 wxXmlNode( aParent, aType, aName, aContent, aProperties )
58 {
59 }
60
62 {
63 return (XNODE* )wxXmlNode::GetChildren();
64 }
65
66 XNODE* GetNext() const
67 {
68 return (XNODE* )wxXmlNode::GetNext();
69 }
70
72 {
73 return (XNODE* )wxXmlNode::GetParent();
74 }
75
83 virtual void Format( OUTPUTFORMATTER* out, int nestLevel );
84
94 virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel );
95
96};
97
98#endif // XNODE_H_
An interface used to output 8 bit text in a convenient way.
Definition: richio.h:322
Hold an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetParent() const
Definition: xnode.h:71
XNODE(wxXmlNodeType aType, const wxString &aName, const wxString &aContent=wxEmptyString)
Definition: xnode.h:50
XNODE * GetChildren() const
Definition: xnode.h:61
XNODE * GetNext() const
Definition: xnode.h:66
XNODE()
Definition: xnode.h:45
XNODE(XNODE *aParent, wxXmlNodeType aType, const wxString &aName, const wxString &aContent=wxEmptyString, wxXmlAttribute *aProperties=nullptr)
Definition: xnode.h:55
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:54
virtual void Format(OUTPUTFORMATTER *out, int nestLevel)
Write this object as UTF8 out to an OUTPUTFORMATTER as an S-expression.
Definition: xnode.cpp:35