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