Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef txXPathObjectAdaptor_h__
7 #define txXPathObjectAdaptor_h__
9 #include "txExprResult.h"
10 #include "txINodeSet.h"
11 #include "txIXPathObject.h"
13 /**
14 * Implements an XPCOM wrapper around XPath data types boolean, number, string,
15 * or nodeset.
16 */
18 class txXPathObjectAdaptor : public txIXPathObject
19 {
20 public:
21 txXPathObjectAdaptor(txAExprResult *aValue) : mValue(aValue)
22 {
23 NS_ASSERTION(aValue,
24 "Don't create a txXPathObjectAdaptor if you don't have a "
25 "txAExprResult");
26 }
27 virtual ~txXPathObjectAdaptor() {}
29 NS_DECL_ISUPPORTS
31 NS_IMETHODIMP_(txAExprResult*) GetResult()
32 {
33 return mValue;
34 }
36 protected:
37 txXPathObjectAdaptor() : mValue(nullptr)
38 {
39 }
41 nsRefPtr<txAExprResult> mValue;
42 };
44 #endif // txXPathObjectAdaptor_h__