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 : #include "txNodeSetContext.h"
7 : #include "txNodeSet.h"
8 :
9 0 : const txXPathNode& txNodeSetContext::getContextNode()
10 : {
11 0 : return mContextSet->get(mPosition - 1);
12 : }
13 :
14 0 : uint32_t txNodeSetContext::size()
15 : {
16 0 : return (uint32_t)mContextSet->size();
17 : }
18 :
19 0 : uint32_t txNodeSetContext::position()
20 : {
21 0 : NS_ASSERTION(mPosition, "Should have called next() at least once");
22 0 : return mPosition;
23 : }
24 :
25 0 : nsresult txNodeSetContext::getVariable(int32_t aNamespace, nsIAtom* aLName,
26 : txAExprResult*& aResult)
27 : {
28 0 : NS_ASSERTION(mInner, "mInner is null!!!");
29 0 : return mInner->getVariable(aNamespace, aLName, aResult);
30 : }
31 :
32 : nsresult
33 0 : txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode, bool& aAllowed)
34 : {
35 0 : NS_ASSERTION(mInner, "mInner is null!!!");
36 0 : return mInner->isStripSpaceAllowed(aNode, aAllowed);
37 : }
38 :
39 0 : void* txNodeSetContext::getPrivateContext()
40 : {
41 0 : NS_ASSERTION(mInner, "mInner is null!!!");
42 0 : return mInner->getPrivateContext();
43 : }
44 :
45 0 : txResultRecycler* txNodeSetContext::recycler()
46 : {
47 0 : NS_ASSERTION(mInner, "mInner is null!!!");
48 0 : return mInner->recycler();
49 : }
50 :
51 0 : void txNodeSetContext::receiveError(const nsAString& aMsg, nsresult aRes)
52 : {
53 0 : NS_ASSERTION(mInner, "mInner is null!!!");
54 : #ifdef DEBUG
55 0 : nsAutoString error(NS_LITERAL_STRING("forwarded error: "));
56 0 : error.Append(aMsg);
57 0 : mInner->receiveError(error, aRes);
58 : #else
59 : mInner->receiveError(aMsg, aRes);
60 : #endif
61 0 : }
|