summaryrefslogtreecommitdiff
path: root/docs/html/classpugi_1_1xpath__query.html
blob: d4eea32df0862bb0d31aca6e46060831cec2c317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>pugixml: pugi::xpath_query Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6-NO -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<a class="el" href="namespacepugi.html">pugi</a>::<a class="el" href="classpugi_1_1xpath__query.html">xpath_query</a></div>
<h1>pugi::xpath_query Class Reference</h1><!-- doxytag: class="pugi::xpath_query" -->Collaboration diagram for pugi::xpath_query:<p><center><img src="classpugi_1_1xpath__query__coll__graph.png" border="0" usemap="#pugi_1_1xpath__query__coll__map" alt="Collaboration graph"></center>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classpugi_1_1xpath__query-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
A class that holds compiled XPath query and allows to evaluate query result. 
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpugi_1_1xpath__query.html#ee39fc174aa9048b5c1ea24d26451566">xpath_query</a> (const <a class="el" href="namespacepugi.html#b1b14d3e95e40b2a55befefb0b9a04aa">char_t</a> *query)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Ctor from string with XPath expression.  <a href="#ee39fc174aa9048b5c1ea24d26451566"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0ca09e7de62e46feb64d03995f389da3"></a><!-- doxytag: member="pugi::xpath_query::~xpath_query" ref="0ca09e7de62e46feb64d03995f389da3" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpugi_1_1xpath__query.html#0ca09e7de62e46feb64d03995f389da3">~xpath_query</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Dtor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespacepugi.html#51b15030472dcfa64b5c0d2252f8261d">xpath_type_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpugi_1_1xpath__query.html#6e4cafbd247cec997e9a55e705fc2f19">return_type</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get query expression return type.  <a href="#6e4cafbd247cec997e9a55e705fc2f19"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpugi_1_1xpath__query.html#7f4bd3d0e43b3242c5435b7279ab6feb">evaluate_boolean</a> (const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;n) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluate expression as boolean value for the context node <em>n</em>.  <a href="#7f4bd3d0e43b3242c5435b7279ab6feb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpugi_1_1xpath__query.html#d6538470814cbf572971e83a912f5bd5">evaluate_number</a> (const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;n) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluate expression as double value for the context node <em>n</em>.  <a href="#d6538470814cbf572971e83a912f5bd5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespacepugi.html#009e541d184dda0373445df1601a1e96">string_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpugi_1_1xpath__query.html#ef5de04abed0897f1aacdaffea59250a">evaluate_string</a> (const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;n) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluate expression as string value for the context node <em>n</em>.  <a href="#ef5de04abed0897f1aacdaffea59250a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classpugi_1_1xpath__node__set.html">xpath_node_set</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpugi_1_1xpath__query.html#de21ad3afc39efd1db110a0dfca7b865">evaluate_node_set</a> (const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;n) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluate expression as node set for the context node <em>n</em>.  <a href="#de21ad3afc39efd1db110a0dfca7b865"></a><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="ee39fc174aa9048b5c1ea24d26451566"></a><!-- doxytag: member="pugi::xpath_query::xpath_query" ref="ee39fc174aa9048b5c1ea24d26451566" args="(const char_t *query)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">pugi::xpath_query::xpath_query           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="namespacepugi.html#b1b14d3e95e40b2a55befefb0b9a04aa">char_t</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>query</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [explicit]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Ctor from string with XPath expression. 
<p>
Throws <a class="el" href="classpugi_1_1xpath__exception.html">xpath_exception</a> on compilation error, std::bad_alloc on out of memory error.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>query</em>&nbsp;</td><td>- string with XPath expression </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="6e4cafbd247cec997e9a55e705fc2f19"></a><!-- doxytag: member="pugi::xpath_query::return_type" ref="6e4cafbd247cec997e9a55e705fc2f19" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="namespacepugi.html#51b15030472dcfa64b5c0d2252f8261d">xpath_type_t</a> pugi::xpath_query::return_type           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get query expression return type. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>expression return type </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="7f4bd3d0e43b3242c5435b7279ab6feb"></a><!-- doxytag: member="pugi::xpath_query::evaluate_boolean" ref="7f4bd3d0e43b3242c5435b7279ab6feb" args="(const xml_node &amp;n) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">bool pugi::xpath_query::evaluate_boolean           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>n</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Evaluate expression as boolean value for the context node <em>n</em>. 
<p>
If expression does not directly evaluate to boolean, the expression result is converted as through boolean() XPath function call. Throws std::bad_alloc on out of memory error.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>- context node </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>evaluation result </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="d6538470814cbf572971e83a912f5bd5"></a><!-- doxytag: member="pugi::xpath_query::evaluate_number" ref="d6538470814cbf572971e83a912f5bd5" args="(const xml_node &amp;n) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">double pugi::xpath_query::evaluate_number           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>n</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Evaluate expression as double value for the context node <em>n</em>. 
<p>
If expression does not directly evaluate to double, the expression result is converted as through number() XPath function call. Throws std::bad_alloc on out of memory error.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>- context node </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>evaluation result </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ef5de04abed0897f1aacdaffea59250a"></a><!-- doxytag: member="pugi::xpath_query::evaluate_string" ref="ef5de04abed0897f1aacdaffea59250a" args="(const xml_node &amp;n) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="namespacepugi.html#009e541d184dda0373445df1601a1e96">string_t</a> pugi::xpath_query::evaluate_string           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>n</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Evaluate expression as string value for the context node <em>n</em>. 
<p>
If expression does not directly evaluate to string, the expression result is converted as through string() XPath function call. Throws std::bad_alloc on out of memory error.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>- context node </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>evaluation result </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="de21ad3afc39efd1db110a0dfca7b865"></a><!-- doxytag: member="pugi::xpath_query::evaluate_node_set" ref="de21ad3afc39efd1db110a0dfca7b865" args="(const xml_node &amp;n) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="classpugi_1_1xpath__node__set.html">xpath_node_set</a> pugi::xpath_query::evaluate_node_set           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classpugi_1_1xml__node.html">xml_node</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>n</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Evaluate expression as node set for the context node <em>n</em>. 
<p>
If expression does not directly evaluate to node set, throws <a class="el" href="classpugi_1_1xpath__exception.html">xpath_exception</a>. Throws std::bad_alloc on out of memory error.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>- context node </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>evaluation result </dd></dl>
    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue May 25 23:22:40 2010 for pugixml by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6-NO </small></address>
</body>
</html>