michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef txXPathObjectAdaptor_h__ michael@0: #define txXPathObjectAdaptor_h__ michael@0: michael@0: #include "txExprResult.h" michael@0: #include "txINodeSet.h" michael@0: #include "txIXPathObject.h" michael@0: michael@0: /** michael@0: * Implements an XPCOM wrapper around XPath data types boolean, number, string, michael@0: * or nodeset. michael@0: */ michael@0: michael@0: class txXPathObjectAdaptor : public txIXPathObject michael@0: { michael@0: public: michael@0: txXPathObjectAdaptor(txAExprResult *aValue) : mValue(aValue) michael@0: { michael@0: NS_ASSERTION(aValue, michael@0: "Don't create a txXPathObjectAdaptor if you don't have a " michael@0: "txAExprResult"); michael@0: } michael@0: virtual ~txXPathObjectAdaptor() {} michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: NS_IMETHODIMP_(txAExprResult*) GetResult() michael@0: { michael@0: return mValue; michael@0: } michael@0: michael@0: protected: michael@0: txXPathObjectAdaptor() : mValue(nullptr) michael@0: { michael@0: } michael@0: michael@0: nsRefPtr mValue; michael@0: }; michael@0: michael@0: #endif // txXPathObjectAdaptor_h__