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 "txForwardContext.h" michael@0: #include "txNodeSet.h" michael@0: michael@0: const txXPathNode& txForwardContext::getContextNode() michael@0: { michael@0: return mContextNode; michael@0: } michael@0: michael@0: uint32_t txForwardContext::size() michael@0: { michael@0: return (uint32_t)mContextSet->size(); michael@0: } michael@0: michael@0: uint32_t txForwardContext::position() michael@0: { michael@0: int32_t pos = mContextSet->indexOf(mContextNode); michael@0: NS_ASSERTION(pos >= 0, "Context is not member of context node list."); michael@0: return (uint32_t)(pos + 1); michael@0: } michael@0: michael@0: nsresult txForwardContext::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 txForwardContext::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* txForwardContext::getPrivateContext() michael@0: { michael@0: NS_ASSERTION(mInner, "mInner is null!!!"); michael@0: return mInner->getPrivateContext(); michael@0: } michael@0: michael@0: txResultRecycler* txForwardContext::recycler() michael@0: { michael@0: NS_ASSERTION(mInner, "mInner is null!!!"); michael@0: return mInner->recycler(); michael@0: } michael@0: michael@0: void txForwardContext::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: }