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