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 <dick@softplc.com>
5  * Copyright (C) 1992-2010 KiCAd Developers, see change_log.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 
43 class XNODE : public wxXmlNode
44 {
45 public:
46  //-----<overloads>---------------------------------------------------------
47  XNODE() :
48  wxXmlNode()
49  {
50  }
51 
52  XNODE( wxXmlNodeType aType, const wxString& aName, const wxString& aContent = wxEmptyString ) :
53  wxXmlNode( NULL, aType, aName, aContent )
54  {
55  }
56 
57  XNODE( XNODE* aParent, wxXmlNodeType aType, const wxString& aName,
58  const wxString& aContent = wxEmptyString, wxXmlAttribute* aProperties = NULL ) :
59  wxXmlNode( aParent, aType, aName, aContent, aProperties )
60  {
61  }
62 
63  XNODE* GetChildren() const
64  {
65  return (XNODE* )wxXmlNode::GetChildren();
66  }
67 
68  XNODE* GetNext() const
69  {
70  return (XNODE* )wxXmlNode::GetNext();
71  }
72 
73  XNODE* GetParent() const
74  {
75  return (XNODE* )wxXmlNode::GetParent();
76  }
77  //-----</overloads>--------------------------------------------------------
78 
86  virtual void Format( OUTPUTFORMATTER* out, int nestLevel );
87 
96  virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel );
97 
98 };
99 
100 #endif // XNODE_H_
virtual void FormatContents(OUTPUTFORMATTER *out, int nestLevel)
Function FormatContents writes the contents of object as UTF8 out to an OUTPUTFORMATTER as an S-expre...
Definition: xnode.cpp:51
XNODE()
Definition: xnode.h:47
Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a conve...
Definition: richio.h:327
XNODE * GetParent() const
Definition: xnode.h:73
XNODE * GetChildren() const
Definition: xnode.h:63
virtual void Format(OUTPUTFORMATTER *out, int nestLevel)
Function Format writes this object as UTF8 out to an OUTPUTFORMATTER as an S-expression.
Definition: xnode.cpp:32
Class XNODE holds an XML or S-expression element.
Definition: xnode.h:43
XNODE(XNODE *aParent, wxXmlNodeType aType, const wxString &aName, const wxString &aContent=wxEmptyString, wxXmlAttribute *aProperties=NULL)
Definition: xnode.h:57
XNODE(wxXmlNodeType aType, const wxString &aName, const wxString &aContent=wxEmptyString)
Definition: xnode.h:52
XNODE * GetNext() const
Definition: xnode.h:68