2005-11-02 07:37:50 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2005-11-02 07:37:50 +00:00
|
|
|
|
|
|
|
#include "txNodeSetContext.h"
|
2005-11-02 07:41:38 +00:00
|
|
|
#include "txNodeSet.h"
|
2005-11-02 07:37:50 +00:00
|
|
|
|
2005-11-02 07:41:43 +00:00
|
|
|
const txXPathNode& txNodeSetContext::getContextNode()
|
2005-11-02 07:37:50 +00:00
|
|
|
{
|
|
|
|
return mContextSet->get(mPosition - 1);
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t txNodeSetContext::size()
|
2005-11-02 07:37:50 +00:00
|
|
|
{
|
2012-08-22 15:56:38 +00:00
|
|
|
return (uint32_t)mContextSet->size();
|
2005-11-02 07:37:50 +00:00
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t txNodeSetContext::position()
|
2005-11-02 07:37:50 +00:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mPosition, "Should have called next() at least once");
|
|
|
|
return mPosition;
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult txNodeSetContext::getVariable(int32_t aNamespace, nsIAtom* aLName,
|
2005-11-02 07:40:48 +00:00
|
|
|
txAExprResult*& aResult)
|
2005-11-02 07:37:50 +00:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
return mInner->getVariable(aNamespace, aLName, aResult);
|
|
|
|
}
|
|
|
|
|
2011-11-10 19:26:13 +00:00
|
|
|
bool txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode)
|
2005-11-02 07:37:50 +00:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
return mInner->isStripSpaceAllowed(aNode);
|
|
|
|
}
|
|
|
|
|
2005-11-02 07:40:09 +00:00
|
|
|
void* txNodeSetContext::getPrivateContext()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
return mInner->getPrivateContext();
|
|
|
|
}
|
|
|
|
|
2005-11-02 07:40:48 +00:00
|
|
|
txResultRecycler* txNodeSetContext::recycler()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
return mInner->recycler();
|
|
|
|
}
|
|
|
|
|
2005-11-02 07:39:22 +00:00
|
|
|
void txNodeSetContext::receiveError(const nsAString& aMsg, nsresult aRes)
|
2005-11-02 07:37:50 +00:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
#ifdef DEBUG
|
2005-11-02 07:39:22 +00:00
|
|
|
nsAutoString error(NS_LITERAL_STRING("forwarded error: "));
|
2005-11-02 07:38:52 +00:00
|
|
|
error.Append(aMsg);
|
2005-11-02 07:37:50 +00:00
|
|
|
mInner->receiveError(error, aRes);
|
|
|
|
#else
|
|
|
|
mInner->receiveError(aMsg, aRes);
|
|
|
|
#endif
|
|
|
|
}
|