2005-11-02 10:37:50 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04: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 10:37:50 +03:00
|
|
|
|
|
|
|
#include "txNodeSetContext.h"
|
2005-11-02 10:41:38 +03:00
|
|
|
#include "txNodeSet.h"
|
2005-11-02 10:37:50 +03:00
|
|
|
|
2005-11-02 10:41:43 +03:00
|
|
|
const txXPathNode& txNodeSetContext::getContextNode()
|
2005-11-02 10:37:50 +03:00
|
|
|
{
|
|
|
|
return mContextSet->get(mPosition - 1);
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t txNodeSetContext::size()
|
2005-11-02 10:37:50 +03:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
return (uint32_t)mContextSet->size();
|
2005-11-02 10:37:50 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t txNodeSetContext::position()
|
2005-11-02 10:37:50 +03:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mPosition, "Should have called next() at least once");
|
|
|
|
return mPosition;
|
|
|
|
}
|
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
nsresult txNodeSetContext::getVariable(int32_t aNamespace, nsAtom* aLName,
|
2005-11-02 10:40:48 +03:00
|
|
|
txAExprResult*& aResult)
|
2005-11-02 10:37:50 +03:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
return mInner->getVariable(aNamespace, aLName, aResult);
|
|
|
|
}
|
|
|
|
|
2017-03-22 23:05:11 +03:00
|
|
|
nsresult
|
|
|
|
txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode, bool& aAllowed)
|
2005-11-02 10:37:50 +03:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
2017-03-22 23:05:11 +03:00
|
|
|
return mInner->isStripSpaceAllowed(aNode, aAllowed);
|
2005-11-02 10:37:50 +03:00
|
|
|
}
|
|
|
|
|
2005-11-02 10:40:09 +03:00
|
|
|
void* txNodeSetContext::getPrivateContext()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
return mInner->getPrivateContext();
|
|
|
|
}
|
|
|
|
|
2005-11-02 10:40:48 +03:00
|
|
|
txResultRecycler* txNodeSetContext::recycler()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
return mInner->recycler();
|
|
|
|
}
|
|
|
|
|
2005-11-02 10:39:22 +03:00
|
|
|
void txNodeSetContext::receiveError(const nsAString& aMsg, nsresult aRes)
|
2005-11-02 10:37:50 +03:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
|
|
|
#ifdef DEBUG
|
2005-11-02 10:39:22 +03:00
|
|
|
nsAutoString error(NS_LITERAL_STRING("forwarded error: "));
|
2005-11-02 10:38:52 +03:00
|
|
|
error.Append(aMsg);
|
2005-11-02 10:37:50 +03:00
|
|
|
mInner->receiveError(error, aRes);
|
|
|
|
#else
|
|
|
|
mInner->receiveError(aMsg, aRes);
|
|
|
|
#endif
|
|
|
|
}
|