summaryrefslogtreecommitdiff
path: root/Source/WebCore/xml/XPathResult.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/xml/XPathResult.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/xml/XPathResult.h')
-rw-r--r--Source/WebCore/xml/XPathResult.h87
1 files changed, 39 insertions, 48 deletions
diff --git a/Source/WebCore/xml/XPathResult.h b/Source/WebCore/xml/XPathResult.h
index affc076b7..aea8535c3 100644
--- a/Source/WebCore/xml/XPathResult.h
+++ b/Source/WebCore/xml/XPathResult.h
@@ -24,65 +24,56 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef XPathResult_h
-#define XPathResult_h
+#pragma once
+#include "ExceptionOr.h"
#include "XPathValue.h"
-#include <wtf/Forward.h>
-#include <wtf/RefCounted.h>
namespace WebCore {
- typedef int ExceptionCode;
+class XPathResult : public RefCounted<XPathResult> {
+public:
+ enum XPathResultType {
+ ANY_TYPE = 0,
+ NUMBER_TYPE = 1,
+ STRING_TYPE = 2,
+ BOOLEAN_TYPE = 3,
+ UNORDERED_NODE_ITERATOR_TYPE = 4,
+ ORDERED_NODE_ITERATOR_TYPE = 5,
+ UNORDERED_NODE_SNAPSHOT_TYPE = 6,
+ ORDERED_NODE_SNAPSHOT_TYPE = 7,
+ ANY_UNORDERED_NODE_TYPE = 8,
+ FIRST_ORDERED_NODE_TYPE = 9
+ };
- class Document;
- class Node;
+ static Ref<XPathResult> create(Document& document, const XPath::Value& value) { return adoptRef(*new XPathResult(document, value)); }
+ WEBCORE_EXPORT ~XPathResult();
- class XPathResult : public RefCounted<XPathResult> {
- public:
- enum XPathResultType {
- ANY_TYPE = 0,
- NUMBER_TYPE = 1,
- STRING_TYPE = 2,
- BOOLEAN_TYPE = 3,
- UNORDERED_NODE_ITERATOR_TYPE = 4,
- ORDERED_NODE_ITERATOR_TYPE = 5,
- UNORDERED_NODE_SNAPSHOT_TYPE = 6,
- ORDERED_NODE_SNAPSHOT_TYPE = 7,
- ANY_UNORDERED_NODE_TYPE = 8,
- FIRST_ORDERED_NODE_TYPE = 9
- };
-
- static PassRefPtr<XPathResult> create(Document* document, const XPath::Value& value) { return adoptRef(new XPathResult(document, value)); }
- ~XPathResult();
-
- void convertTo(unsigned short type, ExceptionCode&);
+ ExceptionOr<void> convertTo(unsigned short type);
- unsigned short resultType() const;
+ WEBCORE_EXPORT unsigned short resultType() const;
- double numberValue(ExceptionCode&) const;
- String stringValue(ExceptionCode&) const;
- bool booleanValue(ExceptionCode&) const;
- Node* singleNodeValue(ExceptionCode&) const;
+ WEBCORE_EXPORT ExceptionOr<double> numberValue() const;
+ WEBCORE_EXPORT ExceptionOr<String> stringValue() const;
+ WEBCORE_EXPORT ExceptionOr<bool> booleanValue() const;
+ WEBCORE_EXPORT ExceptionOr<Node*> singleNodeValue() const;
- bool invalidIteratorState() const;
- unsigned long snapshotLength(ExceptionCode&) const;
- Node* iterateNext(ExceptionCode&);
- Node* snapshotItem(unsigned long index, ExceptionCode&);
+ WEBCORE_EXPORT bool invalidIteratorState() const;
+ WEBCORE_EXPORT ExceptionOr<unsigned> snapshotLength() const;
+ WEBCORE_EXPORT ExceptionOr<Node*> iterateNext();
+ WEBCORE_EXPORT ExceptionOr<Node*> snapshotItem(unsigned index);
- const XPath::Value& value() const { return m_value; }
+ const XPath::Value& value() const { return m_value; }
- private:
- XPathResult(Document*, const XPath::Value&);
-
- XPath::Value m_value;
- unsigned m_nodeSetPosition;
- XPath::NodeSet m_nodeSet; // FIXME: why duplicate the node set stored in m_value?
- unsigned short m_resultType;
- RefPtr<Document> m_document;
- uint64_t m_domTreeVersion;
- };
+private:
+ XPathResult(Document&, const XPath::Value&);
-} // namespace WebCore
+ XPath::Value m_value;
+ unsigned m_nodeSetPosition { 0 };
+ XPath::NodeSet m_nodeSet; // FIXME: why duplicate the node set stored in m_value?
+ unsigned short m_resultType;
+ RefPtr<Document> m_document;
+ uint64_t m_domTreeVersion { 0 };
+};
-#endif // XPathResult_h
+} // namespace WebCore