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: #include "txNodeSetContext.h" michael@0: #include "txNodeSet.h" michael@0: michael@0: const txXPathNode& txNodeSetContext::getContextNode() michael@0: { michael@0: return mContextSet->get(mPosition - 1); michael@0: } michael@0: michael@0: uint32_t txNodeSetContext::size() michael@0: { michael@0: return (uint32_t)mContextSet->size(); michael@0: } michael@0: michael@0: uint32_t txNodeSetContext::position() michael@0: { michael@0: NS_ASSERTION(mPosition, "Should have called next() at least once"); michael@0: return mPosition; michael@0: } michael@0: michael@0: nsresult txNodeSetContext::getVariable(int32_t aNamespace, nsIAtom* aLName, michael@0: txAExprResult*& aResult) michael@0: { michael@0: NS_ASSERTION(mInner, "mInner is null!!!"); michael@0: return mInner->getVariable(aNamespace, aLName, aResult); michael@0: } michael@0: michael@0: bool txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode) michael@0: { michael@0: NS_ASSERTION(mInner, "mInner is null!!!"); michael@0: return mInner->isStripSpaceAllowed(aNode); michael@0: } michael@0: michael@0: void* txNodeSetContext::getPrivateContext() michael@0: { michael@0: NS_ASSERTION(mInner, "mInner is null!!!"); michael@0: return mInner->getPrivateContext(); michael@0: } michael@0: michael@0: txResultRecycler* txNodeSetContext::recycler() michael@0: { michael@0: NS_ASSERTION(mInner, "mInner is null!!!"); michael@0: return mInner->recycler(); michael@0: } michael@0: michael@0: void txNodeSetContext::receiveError(const nsAString& aMsg, nsresult aRes) michael@0: { michael@0: NS_ASSERTION(mInner, "mInner is null!!!"); michael@0: #ifdef DEBUG michael@0: nsAutoString error(NS_LITERAL_STRING("forwarded error: ")); michael@0: error.Append(aMsg); michael@0: mInner->receiveError(error, aRes); michael@0: #else michael@0: mInner->receiveError(aMsg, aRes); michael@0: #endif michael@0: }