txForwardContext.cpp (1734B)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 #include "txForwardContext.h" 7 8 #include "txNodeSet.h" 9 10 const txXPathNode& txForwardContext::getContextNode() { return mContextNode; } 11 12 uint32_t txForwardContext::size() { return (uint32_t)mContextSet->size(); } 13 14 uint32_t txForwardContext::position() { 15 int32_t pos = mContextSet->indexOf(mContextNode); 16 NS_ASSERTION(pos >= 0, "Context is not member of context node list."); 17 return (uint32_t)(pos + 1); 18 } 19 20 nsresult txForwardContext::getVariable(int32_t aNamespace, nsAtom* aLName, 21 txAExprResult*& aResult) { 22 NS_ASSERTION(mInner, "mInner is null!!!"); 23 return mInner->getVariable(aNamespace, aLName, aResult); 24 } 25 26 nsresult txForwardContext::isStripSpaceAllowed(const txXPathNode& aNode, 27 bool& aAllowed) { 28 NS_ASSERTION(mInner, "mInner is null!!!"); 29 return mInner->isStripSpaceAllowed(aNode, aAllowed); 30 } 31 32 void* txForwardContext::getPrivateContext() { 33 NS_ASSERTION(mInner, "mInner is null!!!"); 34 return mInner->getPrivateContext(); 35 } 36 37 txResultRecycler* txForwardContext::recycler() { 38 NS_ASSERTION(mInner, "mInner is null!!!"); 39 return mInner->recycler(); 40 } 41 42 void txForwardContext::receiveError(const nsAString& aMsg, nsresult aRes) { 43 NS_ASSERTION(mInner, "mInner is null!!!"); 44 #ifdef DEBUG 45 nsAutoString error(u"forwarded error: "_ns); 46 error.Append(aMsg); 47 mInner->receiveError(error, aRes); 48 #else 49 mInner->receiveError(aMsg, aRes); 50 #endif 51 }