dom/xslt/xpath/txNodeSetContext.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xslt/xpath/txNodeSetContext.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "txNodeSetContext.h"
    1.10 +#include "txNodeSet.h"
    1.11 +
    1.12 +const txXPathNode& txNodeSetContext::getContextNode()
    1.13 +{
    1.14 +    return mContextSet->get(mPosition - 1);
    1.15 +}
    1.16 +
    1.17 +uint32_t txNodeSetContext::size()
    1.18 +{
    1.19 +    return (uint32_t)mContextSet->size();
    1.20 +}
    1.21 +
    1.22 +uint32_t txNodeSetContext::position()
    1.23 +{
    1.24 +    NS_ASSERTION(mPosition, "Should have called next() at least once");
    1.25 +    return mPosition;
    1.26 +}
    1.27 +
    1.28 +nsresult txNodeSetContext::getVariable(int32_t aNamespace, nsIAtom* aLName,
    1.29 +                                       txAExprResult*& aResult)
    1.30 +{
    1.31 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.32 +    return mInner->getVariable(aNamespace, aLName, aResult);
    1.33 +}
    1.34 +
    1.35 +bool txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode)
    1.36 +{
    1.37 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.38 +    return mInner->isStripSpaceAllowed(aNode);
    1.39 +}
    1.40 +
    1.41 +void* txNodeSetContext::getPrivateContext()
    1.42 +{
    1.43 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.44 +    return mInner->getPrivateContext();
    1.45 +}
    1.46 +
    1.47 +txResultRecycler* txNodeSetContext::recycler()
    1.48 +{
    1.49 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.50 +    return mInner->recycler();
    1.51 +}
    1.52 +
    1.53 +void txNodeSetContext::receiveError(const nsAString& aMsg, nsresult aRes)
    1.54 +{
    1.55 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.56 +#ifdef DEBUG
    1.57 +    nsAutoString error(NS_LITERAL_STRING("forwarded error: "));
    1.58 +    error.Append(aMsg);
    1.59 +    mInner->receiveError(error, aRes);
    1.60 +#else
    1.61 +    mInner->receiveError(aMsg, aRes);
    1.62 +#endif
    1.63 +}

mercurial