1 \section{\class{wxXmlDocument
}}\label{wxxmldocument
}
3 This class holds XML data/
document as parsed by XML parser in the root node.
5 wxXmlDocument internally uses the expat library which comes with wxWidgets to parse the given stream.
7 \wxheading{Derived from
}
9 \helpref{wxObject
}{wxobject
}
11 \wxheading{Include files
}
17 \helpref{wxXmlNode
}{wxxmlnode
},
\helpref{wxXmlProperty
}{wxxmlproperty
}
20 \latexignore{\rtfignore{\wxheading{Members
}}}
23 \membersection{wxXmlDocument::wxXmlDocument
}\label{wxxmldocumentwxxmldocument
}
25 \func{}{wxXmlDocument
}{\void}
28 \func{}{wxXmlDocument
}{\param{const wxString\&
}{filename
},
\param{const wxString\&
}{encoding = wxT("UTF-
8")
}}
30 Loads the given
{\it filename
} using the given encoding. See
\helpref{Load()
}{wxxmldocumentload
}.
32 \func{}{wxXmlDocument
}{\param{wxInputStream\&
}{stream
},
\param{const wxString\&
}{encoding = wxT("UTF-
8")
}}
34 Loads the XML
document from given stream using the given encoding. See
\helpref{Load()
}{wxxmldocumentload
}.
36 \func{}{wxXmlDocument
}{\param{const wxXmlDocument\&
}{doc
}}
40 \membersection{wxXmlDocument::
\destruct{wxXmlDocument
}}\label{wxxmldocumentdtor
}
42 \func{}{\destruct{wxXmlDocument
}}{\void}
44 Virtual destructor. Frees the
document root node.
46 \membersection{wxXmlDocument::GetEncoding
}\label{wxxmldocumentgetencoding
}
48 \constfunc{wxString
}{GetEncoding
}{\void}
50 Returns encoding of in-memory representation of the
document
51 (same as passed to
\helpref{Load()
}{wxxmldocumentload
} or constructor, defaults to UTF-
8).
53 NB: this is meaningless in Unicode build where data are stored as wchar
\_t*.
56 \membersection{wxXmlDocument::GetFileEncoding
}\label{wxxmldocumentgetfileencoding
}
58 \constfunc{wxString
}{GetFileEncoding
}{\void}
60 Returns encoding of
document (may be empty).
62 Note: this is the encoding original file was saved in, *not* the
63 encoding of in-memory representation!
66 \membersection{wxXmlDocument::GetRoot
}\label{wxxmldocumentgetroot
}
68 \constfunc{wxXmlNode*
}{GetRoot
}{\void}
70 Returns the root node of the
document.
73 \membersection{wxXmlDocument::GetVersion
}\label{wxxmldocumentgetversion
}
75 \constfunc{wxString
}{GetVersion
}{\void}
77 Returns the version of
document.
78 This is the value in the
{\tt <?xml version="
1.0"?>
} header of the XML
document.
79 If the version property was not explicitely given in the header, this function
80 returns an empty string.
83 \membersection{wxXmlDocument::IsOk
}\label{wxxmldocumentisok
}
85 \constfunc{bool
}{IsOk
}{\void}
87 Returns
\true if the
document has been loaded successfully.
90 \membersection{wxXmlDocument::Load
}\label{wxxmldocumentload
}
92 \func{bool
}{Load
}{\param{const wxString\&
}{filename
},
\param{const wxString\&
}{encoding = wxT("UTF-
8")
}}
94 Parses
{\it filename
} as an xml
document and loads data. Returns
\true on success,
\false otherwise.
96 \func{bool
}{Load
}{\param{wxInputStream\&
}{stream
},
\param{const wxString\&
}{encoding = wxT("UTF-
8")
}}
98 Like above but takes the data from given input stream.
100 \membersection{wxXmlDocument::Save
}\label{wxxmldocumentsave
}
102 \constfunc{bool
}{Save
}{\param{const wxString\&
}{filename
}}
104 Saves XML tree creating a file named with given string.
106 \constfunc{bool
}{Save
}{\param{wxOutputStream\&
}{stream
}}
108 Saves XML tree in the given output stream.
110 \membersection{wxXmlDocument::SetEncoding
}\label{wxxmldocumentsetencoding
}
112 \func{void
}{SetEncoding
}{\param{const wxString\&
}{enc
}}
114 Sets the enconding of the
document.
116 \membersection{wxXmlDocument::SetFileEncoding
}\label{wxxmldocumentsetfileencoding
}
118 \func{void
}{SetFileEncoding
}{\param{const wxString\&
}{encoding
}}
120 Sets the enconding of the file which will be used to save the
document.
122 \membersection{wxXmlDocument::SetRoot
}\label{wxxmldocumentsetroot
}
124 \func{void
}{SetRoot
}{\param{wxXmlNode*
}{node
}}
126 Sets the root node of this
document. Deletes previous root node.
128 \membersection{wxXmlDocument::SetVersion
}\label{wxxmldocumentsetversion
}
130 \func{void
}{SetVersion
}{\param{const wxString\&
}{version
}}
132 Sets the version of the XML file which will be used to save the
document.
134 \membersection{wxXmlDocument::operator=
}\label{wxxmldocumentoperatorassign
}
136 \func{wxXmlDocument\& operator
}{operator=
}{\param{const wxXmlDocument\&
}{doc
}}
138 Copies the given
document.