|
wxXml2
|
#include "wx/string.h"#include "wx/object.h"#include "wx/wfstream.h"#include "wx/xml2def.h"#include <libxml/xmlmemory.h>#include <libxml/parser.h>

Go to the source code of this file.
Classes | |
| struct | tagXml2BaseNode |
| The common part of all XML nodes. More... | |
| class | wxXml2 |
| A wrapper for some libxml2 static functions regarding the entire parser. More... | |
| class | wxXml2Wrapper |
| Provides some standard methods for all wxXml2 wrappers. More... | |
| class | wxXml2Property |
| Represents a node property. More... | |
| class | wxXml2Namespace |
| Represents an XML namespace. More... | |
| class | wxXml2Document |
| This class holds XML data/document as parsed by the libxml2 parser. More... | |
| class | wxXml2BaseNode |
| A generic XML node. More... | |
| class | wxXml2Node |
| Represents a node in XML documents. More... | |
| class | wxNativeNewlinesFilterStream |
| A little helper class used by wxXml2Document::Save and wxXml2DTD::Save to convert to the native format of newlines. More... | |
Macros | |
| #define | wxCHECK_NULL_POINTERS(x, y) |
| A macro used in the overloaded operator==; this is the return table: | |
| #define | WX2XML(str) ((xmlChar *)(str.mb_str(wxConvUTF8))) |
| Converts from wxStrings to xmlChars. | |
| #define | XML2WX(str) (wxString((const char *)str, wxConvUTF8)) |
| Converts from xmlChars to wxStrings. | |
| #define | wxXML2DOC_USE_NATIVE_NEWLINES 1 |
| A wxXml2Document::Save flag. | |
| #define | wxXML2DOC_USE_INDENTATION 2 |
| A wxXml2Document::Save flag. | |
| #define | wxXML2CHECK_VERSION(major, minor, release) (LIBXML_VERSION >= major##0##minor##release) |
| Checks if the libxml2 version currently used (when compiling) is newer or match the given version numbers. | |
Typedefs | |
| typedef struct tagXml2BaseNode | wxXml2BaseNodeObj |
| The common part of all XML nodes. | |
Enumerations | |
| enum | wxXml2NodeType { wxXML2_ELEMENT_NODE = 1, wxXML2_TEXT_NODE = 3, wxXML2_CDATA_SECTION_NODE = 4, wxXML2_ENTITY_REF_NODE = 5, wxXML2_PI_NODE = 7, wxXML2_COMMENT_NODE = 8, wxXML2_DOCUMENT_NODE = 9, wxXML2_HTML_DOCUMENT_NODE = 13, wxXML2_DTD_NODE = 14, wxXML2_ELEMENT_DECL = 15, wxXML2_ATTRIBUTE_DECL = 16, wxXML2_ENTITY_DECL = 17, wxXML2_NAMESPACE_DECL = 18 } |
| Represents an XML node type. More... | |
Variables | |
| class WXDLLIMPEXP_WXXML2 | wxXml2BaseNode |
| class WXDLLIMPEXP_WXXML2 | wxXml2Node |
| class WXDLLIMPEXP_WXXML2 | wxXml2Property |
| class WXDLLIMPEXP_WXXML2 | wxXml2Namespace |
| class WXDLLIMPEXP_WXXML2 | wxXml2Document |
| class WXDLLIMPEXP_WXXML2 | wxXml2DTD |
| #define WX2XML | ( | str | ) | ((xmlChar *)(str.mb_str(wxConvUTF8))) |
Converts from wxStrings to xmlChars.
Libxml2 takes sequences of xmlChar (which is defined to be always unsigned char) which are asupposed to be always in UTF8: thus WX2XML converts wxStrings to UTF8.
Referenced by wxXml2Node::AddProperty(), wxXml2Node::Build(), wxXml2ElemContent::Create(), wxXml2Enumeration::Create(), wxXml2ElemDecl::Create(), wxXml2AttrDecl::Create(), wxXml2EntityDecl::Create(), wxXml2Property::Create(), wxXml2DTD::Create(), wxXml2Namespace::Create(), wxXml2Document::Create(), wxXml2Document::Save(), wxXml2Node::SetContent(), wxXml2DTD::SetExternalID(), wxXml2Property::SetName(), wxXml2DTD::SetName(), wxXml2Node::SetName(), wxXml2Namespace::SetPrefix(), wxXml2DTD::SetSystemID(), wxXml2Namespace::SetURI(), wxXml2Property::SetValue(), and wxXml2Document::wxXml2Document().
| #define wxCHECK_NULL_POINTERS | ( | x, | |
| y | |||
| ) |
A macro used in the overloaded operator==; this is the return table:
x y returns
NULL NULL TRUE (they are equal) NULL non-NULL FALSE (they are different) non-NULL NULL FALSE (they are different) non-NULL non-NULL nothing: no 'return' statement is executed: x and y could be equal but they could also be different. The code following the macro must care about this possibility
Referenced by wxXml2Node::Cmp(), wxXml2Node::CmpNoNs(), wxXml2ElemContent::operator==(), wxXml2Enumeration::operator==(), wxXml2ElemDecl::operator==(), wxXml2AttrDecl::operator==(), wxXml2EntityDecl::operator==(), wxXml2Property::operator==(), wxXml2DTD::operator==(), wxXml2Namespace::operator==(), and wxXml2BaseNode::operator==().
| #define wxXML2CHECK_VERSION | ( | major, | |
| minor, | |||
| release | |||
| ) | (LIBXML_VERSION >= major##0##minor##release) |
Checks if the libxml2 version currently used (when compiling) is newer or match the given version numbers.
The version numbers must be: 1 digit for major & minor; always 2 digits for release:
| #define wxXML2DOC_USE_INDENTATION 2 |
A wxXml2Document::Save flag.
Tells wxXml2Document to save the document using an indentation step.
Referenced by wxXml2Document::Save().
| #define wxXML2DOC_USE_NATIVE_NEWLINES 1 |
A wxXml2Document::Save flag.
Tells wxXml2Document to save the document using the native newline format; if not specified all newlines will be encoded in unix format (that is, as simple '
').
Referenced by wxXml2DTD::Save(), and wxXml2Document::Save().
| #define XML2WX | ( | str | ) | (wxString((const char *)str, wxConvUTF8)) |
Converts from xmlChars to wxStrings.
Libxml2 always outputs a sequence of xmlChar which are encoded in UTF8: this macro creates a wxString which converts the given string from UTF8 to the format internally used by wxString (whatever it is).
Referenced by wxXml2EntityDecl::GetContent(), wxXml2Node::GetContent(), wxXml2AttrDecl::GetDefaultVal(), wxXml2AttrDecl::GetElementName(), wxXml2EntityDecl::GetExternalID(), wxXml2DTD::GetExternalID(), wxXml2DTD::GetExternalURI(), wxXml2Document::GetFileEncoding(), wxXml2ElemContent::GetName(), wxXml2Enumeration::GetName(), wxXml2AttrDecl::GetName(), wxXml2EntityDecl::GetName(), wxXml2Property::GetName(), wxXml2DTD::GetName(), wxXml2Node::GetName(), wxXml2ElemContent::GetNamespace(), wxXml2ElemDecl::GetNamespace(), wxXml2AttrDecl::GetNamespace(), wxXml2Node::GetNodeContent(), wxXml2Namespace::GetPrefix(), wxXml2EntityDecl::GetSystemID(), wxXml2DTD::GetSystemID(), wxXml2Namespace::GetURI(), wxXml2Property::GetValue(), wxXml2Document::GetVersion(), wxXml2ElemContent::operator==(), wxXml2Enumeration::operator==(), wxXml2ElemDecl::operator==(), wxXml2AttrDecl::operator==(), and wxXml2EntityDecl::operator==().
| typedef struct tagXml2BaseNode wxXml2BaseNodeObj |
The common part of all XML nodes.
This structure has been copied-and-pasted from line 440 of tree.h of the libxml2 xmlNode structure.
| enum wxXml2NodeType |
Represents an XML node type.
LibXML2 allows a lot of different element types, but the following are the types you can use with the wxXml2 wrappers...
| wxXML2_ELEMENT_NODE |
Container nodes; they are characterized by the NAME, the NAMESPACE and the CHILDRENs. They create something like: <NAME>children</NAME> or (if namespace != wxXml2EmptyNamespace), <NS:NAME>children</NS:NAME> Examples: wxXml2Node container(wxXML2_ELEMENT_NODE, parentnode, "MYTAG"); container.AddChild(....); |
| wxXML2_TEXT_NODE |
Nodes containing text; they are characterized by VALUE (or CONTENT). |
| wxXML2_CDATA_SECTION_NODE |
Creates something like: <![CDATA[content]]> To use this type of node, create a container node and then use the SetType(wxXML2_CDATA_SECTION_NODE) function. To set content use wxXml2Node::SetContent. |
| wxXML2_ENTITY_REF_NODE |
Like a text node, but this node contains only an "entity". Entities are strings like: & or " or < .... To create them, use wxXml2Node entityref(wxXML2_TEXT_NODE, parentnode, "&"); containernode.AddChild(entityref); |
| wxXML2_PI_NODE |
Creates a Processing Instruction (PI) node. Such type of nodes looks like: <?name content ?> To use this type of node, create a container node and then use SetType(). To add 'properties', you cannot use wxXml2Property; instead use wxXml2Node::SetContent("property=\"value""). |
| wxXML2_COMMENT_NODE |
Creates a comment node: . |
| wxXML2_DOCUMENT_NODE |
The value of the "type" member of an xmlDoc structure. This value is used to identify a node as a wxXml2Document. Never use it directly: use wxXml2Document instead. |
| wxXML2_HTML_DOCUMENT_NODE |
Like wxXML2_DOCUMENT_NODE. |
| wxXML2_DTD_NODE |
The value of the "type" member of an xmlDtd structure. This value is used to identify a node as a wxXml2DTD. Never use it directly: use wxXml2DTD instead. |
| wxXML2_ELEMENT_DECL |
A DTD node which declares an element. This value is used to identify a node as a wxXml2ElemDecl. Looks like: <!ELEMENT mynode (#PCDATA)> |
| wxXML2_ATTRIBUTE_DECL |
A DTD node which declares an attribute. This value is used to identify a node as a wxXml2AttrDecl. Looks like: <!ATTLIST myattr type #PCDATA "defaultvalue"> |
| wxXML2_ENTITY_DECL |
A DTD node which declares an entity. This value is used to identify a node as a wxXml2EntityDecl. Looks like: <!ENTITY myentity "entity's replacement"> |
| wxXML2_NAMESPACE_DECL |
The value of the "type" member of an xmlNs structure. This value is used to identify a node as a wxXml2Namespace. Never use it directly: use wxXml2Namespace instead. |
| WXDLLIMPEXP_DATA_WXXML2 | ( | wxXml2Node | ) |
| WXDLLIMPEXP_DATA_WXXML2 | ( | wxXml2Property | ) |
| WXDLLIMPEXP_DATA_WXXML2 | ( | wxXml2Namespace | ) |
| WXDLLIMPEXP_DATA_WXXML2 | ( | wxXml2Document | ) |
| WXDLLIMPEXP_DATA_WXXML2 | ( | wxXml2BaseNode | ) |
Referenced by wxXml2Node::GetDoc(), and wxXml2DTD::Load().
| class WXDLLIMPEXP_WXXML2 wxXml2DTD |
| class WXDLLIMPEXP_WXXML2 wxXml2Node |
Referenced by wxXml2Property::GetNext(), wxXml2Property::GetPrevious(), and wxXml2Node::GetProperties().
1.8.2