Line data Source code
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/. */
5 :
6 : #ifndef txXPathObjectAdaptor_h__
7 : #define txXPathObjectAdaptor_h__
8 :
9 : #include "txExprResult.h"
10 : #include "txINodeSet.h"
11 : #include "txIXPathObject.h"
12 :
13 : /**
14 : * Implements an XPCOM wrapper around XPath data types boolean, number, string,
15 : * or nodeset.
16 : */
17 :
18 : class txXPathObjectAdaptor : public txIXPathObject
19 : {
20 : public:
21 0 : explicit txXPathObjectAdaptor(txAExprResult* aValue) : mValue(aValue)
22 : {
23 0 : NS_ASSERTION(aValue,
24 : "Don't create a txXPathObjectAdaptor if you don't have a "
25 : "txAExprResult");
26 0 : }
27 :
28 : NS_DECL_ISUPPORTS
29 :
30 0 : NS_IMETHOD_(txAExprResult*) GetResult() override
31 : {
32 0 : return mValue;
33 : }
34 :
35 : protected:
36 0 : txXPathObjectAdaptor() : mValue(nullptr)
37 : {
38 0 : }
39 :
40 0 : virtual ~txXPathObjectAdaptor() {}
41 :
42 : RefPtr<txAExprResult> mValue;
43 : };
44 :
45 : #endif // txXPathObjectAdaptor_h__
|