]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/xmldocument.tex
document that Remove(index) doesn't delete the window neither (replaces patch 1470834)
[wxWidgets.git] / docs / latex / wx / xmldocument.tex
1 \section{\class{wxXmlDocument}}\label{wxxmldocument}
2
3 This class holds XML data/document as parsed by XML parser in the root node.
4
5 wxXmlDocument internally uses the expat library which comes with wxWidgets to parse the given stream.
6
7 \wxheading{Derived from}
8
9 \helpref{wxObject}{wxobject}
10
11 \wxheading{Include files}
12
13 <wx/xml/xml.h>
14
15 \wxheading{See also}
16
17 \helpref{wxXmlNode}{wxxmlnode}, \helpref{wxXmlProperty}{wxxmlproperty}
18
19
20 \latexignore{\rtfignore{\wxheading{Members}}}
21
22
23 \membersection{wxXmlDocument::wxXmlDocument}\label{wxxmldocumentwxxmldocument}
24
25 \func{}{wxXmlDocument}{\void}
26
27
28 \func{}{wxXmlDocument}{\param{const wxString\& }{filename}, \param{const wxString\& }{encoding = wxT("UTF-8")}}
29
30 Loads the given {\it filename} using the given encoding. See \helpref{Load()}{wxxmldocumentload}.
31
32 \func{}{wxXmlDocument}{\param{wxInputStream\& }{stream}, \param{const wxString\& }{encoding = wxT("UTF-8")}}
33
34 Loads the XML document from given stream using the given encoding. See \helpref{Load()}{wxxmldocumentload}.
35
36 \func{}{wxXmlDocument}{\param{const wxXmlDocument\& }{doc}}
37
38 Copy constructor.
39
40 \membersection{wxXmlDocument::\destruct{wxXmlDocument}}\label{wxxmldocumentdtor}
41
42 \func{}{\destruct{wxXmlDocument}}{\void}
43
44 Virtual destructor. Frees the document root node.
45
46 \membersection{wxXmlDocument::GetEncoding}\label{wxxmldocumentgetencoding}
47
48 \constfunc{wxString}{GetEncoding}{\void}
49
50 Returns encoding of in-memory representation of the document
51 (same as passed to \helpref{Load()}{wxxmldocumentload} or constructor, defaults to UTF-8).
52
53 NB: this is meaningless in Unicode build where data are stored as wchar\_t*.
54
55
56 \membersection{wxXmlDocument::GetFileEncoding}\label{wxxmldocumentgetfileencoding}
57
58 \constfunc{wxString}{GetFileEncoding}{\void}
59
60 Returns encoding of document (may be empty).
61
62 Note: this is the encoding original file was saved in, *not* the
63 encoding of in-memory representation!
64
65
66 \membersection{wxXmlDocument::GetRoot}\label{wxxmldocumentgetroot}
67
68 \constfunc{wxXmlNode*}{GetRoot}{\void}
69
70 Returns the root node of the document.
71
72
73 \membersection{wxXmlDocument::GetVersion}\label{wxxmldocumentgetversion}
74
75 \constfunc{wxString}{GetVersion}{\void}
76
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.
81
82
83 \membersection{wxXmlDocument::IsOk}\label{wxxmldocumentisok}
84
85 \constfunc{bool}{IsOk}{\void}
86
87 Returns \true if the document has been loaded successfully.
88
89
90 \membersection{wxXmlDocument::Load}\label{wxxmldocumentload}
91
92 \func{bool}{Load}{\param{const wxString\& }{filename}, \param{const wxString\& }{encoding = wxT("UTF-8")}}
93
94 Parses {\it filename} as an xml document and loads data. Returns \true on success, \false otherwise.
95
96 \func{bool}{Load}{\param{wxInputStream\& }{stream}, \param{const wxString\& }{encoding = wxT("UTF-8")}}
97
98 Like above but takes the data from given input stream.
99
100 \membersection{wxXmlDocument::Save}\label{wxxmldocumentsave}
101
102 \constfunc{bool}{Save}{\param{const wxString\& }{filename}}
103
104 Saves XML tree creating a file named with given string.
105
106 \constfunc{bool}{Save}{\param{wxOutputStream\& }{stream}}
107
108 Saves XML tree in the given output stream.
109
110 \membersection{wxXmlDocument::SetEncoding}\label{wxxmldocumentsetencoding}
111
112 \func{void}{SetEncoding}{\param{const wxString\& }{enc}}
113
114 Sets the enconding of the document.
115
116 \membersection{wxXmlDocument::SetFileEncoding}\label{wxxmldocumentsetfileencoding}
117
118 \func{void}{SetFileEncoding}{\param{const wxString\& }{encoding}}
119
120 Sets the enconding of the file which will be used to save the document.
121
122 \membersection{wxXmlDocument::SetRoot}\label{wxxmldocumentsetroot}
123
124 \func{void}{SetRoot}{\param{wxXmlNode* }{node}}
125
126 Sets the root node of this document. Deletes previous root node.
127
128 \membersection{wxXmlDocument::SetVersion}\label{wxxmldocumentsetversion}
129
130 \func{void}{SetVersion}{\param{const wxString\& }{version}}
131
132 Sets the version of the XML file which will be used to save the document.
133
134 \membersection{wxXmlDocument::operator=}\label{wxxmldocumentoperatorassign}
135
136 \func{wxXmlDocument\& operator}{operator=}{\param{const wxXmlDocument\& }{doc}}
137
138 Copies the given document.
139