dom/xslt/xpath/txForwardContext.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xslt/xpath/txForwardContext.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,61 @@
     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 "txForwardContext.h"
    1.10 +#include "txNodeSet.h"
    1.11 +
    1.12 +const txXPathNode& txForwardContext::getContextNode()
    1.13 +{
    1.14 +    return mContextNode;
    1.15 +}
    1.16 +
    1.17 +uint32_t txForwardContext::size()
    1.18 +{
    1.19 +    return (uint32_t)mContextSet->size();
    1.20 +}
    1.21 +
    1.22 +uint32_t txForwardContext::position()
    1.23 +{
    1.24 +    int32_t pos = mContextSet->indexOf(mContextNode);
    1.25 +    NS_ASSERTION(pos >= 0, "Context is not member of context node list.");
    1.26 +    return (uint32_t)(pos + 1);
    1.27 +}
    1.28 +
    1.29 +nsresult txForwardContext::getVariable(int32_t aNamespace, nsIAtom* aLName,
    1.30 +                                       txAExprResult*& aResult)
    1.31 +{
    1.32 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.33 +    return mInner->getVariable(aNamespace, aLName, aResult);
    1.34 +}
    1.35 +
    1.36 +bool txForwardContext::isStripSpaceAllowed(const txXPathNode& aNode)
    1.37 +{
    1.38 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.39 +    return mInner->isStripSpaceAllowed(aNode);
    1.40 +}
    1.41 +
    1.42 +void* txForwardContext::getPrivateContext()
    1.43 +{
    1.44 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.45 +    return mInner->getPrivateContext();
    1.46 +}
    1.47 +
    1.48 +txResultRecycler* txForwardContext::recycler()
    1.49 +{
    1.50 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.51 +    return mInner->recycler();
    1.52 +}
    1.53 +
    1.54 +void txForwardContext::receiveError(const nsAString& aMsg, nsresult aRes)
    1.55 +{
    1.56 +    NS_ASSERTION(mInner, "mInner is null!!!");
    1.57 +#ifdef DEBUG
    1.58 +    nsAutoString error(NS_LITERAL_STRING("forwarded error: "));
    1.59 +    error.Append(aMsg);
    1.60 +    mInner->receiveError(error, aRes);
    1.61 +#else
    1.62 +    mInner->receiveError(aMsg, aRes);
    1.63 +#endif
    1.64 +}

mercurial