KHtml

parsedstatement.h
1 /*
2  * parsedstatement.h - Copyright 2005 Frerich Raabe <[email protected]>
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 #ifndef PARSEDSTATEMENT_H
26 #define PARSEDSTATEMENT_H
27 
28 #include "util.h"
29 
30 namespace DOM
31 {
32 class NodeImpl;
33 class DOMString;
34 }
35 
36 namespace khtml
37 {
38 
39 class XPathNSResolverImpl;
40 
41 namespace XPath
42 {
43 
44 class Expression;
45 class Value;
46 
47 class ParsedStatement
48 {
49 public:
50  ParsedStatement(const DOM::DOMString &statement, khtml::XPathNSResolverImpl *res);
51  ~ParsedStatement();
52  void optimize();
53 
54  QString dump() const;
55 
56  Value evaluate(DOM::NodeImpl *context,
57  int &ec) const;
58 
59  // Any exception issued during parsing, or 0
60  int exceptionCode()
61  {
62  return m_ec;
63  }
64 
65 private:
66  void parse(const DOM::DOMString &statement);
67 
68  SharedPtr<khtml::XPathNSResolverImpl> m_res;
69  Expression *m_expr;
70  int m_ec;
71 };
72 
73 } // namespace XPath
74 
75 } // namespace khtml
76 
77 #endif // PARSEDSTATEMENT_H
78 
This file is part of the HTML rendering engine for KDE.
KHEALTHCERTIFICATE_EXPORT QVariant parse(const QByteArray &data)
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
This library provides a full-featured HTML parser and widget.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:47:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.