tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

txNodeSetContext.cpp (1690B)


      1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      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 "txNodeSetContext.h"
      7 
      8 #include "txNodeSet.h"
      9 
     10 const txXPathNode& txNodeSetContext::getContextNode() {
     11  return mContextSet->get(mPosition - 1);
     12 }
     13 
     14 uint32_t txNodeSetContext::size() { return (uint32_t)mContextSet->size(); }
     15 
     16 uint32_t txNodeSetContext::position() {
     17  NS_ASSERTION(mPosition, "Should have called next() at least once");
     18  return mPosition;
     19 }
     20 
     21 nsresult txNodeSetContext::getVariable(int32_t aNamespace, nsAtom* aLName,
     22                                       txAExprResult*& aResult) {
     23  NS_ASSERTION(mInner, "mInner is null!!!");
     24  return mInner->getVariable(aNamespace, aLName, aResult);
     25 }
     26 
     27 nsresult txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode,
     28                                               bool& aAllowed) {
     29  NS_ASSERTION(mInner, "mInner is null!!!");
     30  return mInner->isStripSpaceAllowed(aNode, aAllowed);
     31 }
     32 
     33 void* txNodeSetContext::getPrivateContext() {
     34  NS_ASSERTION(mInner, "mInner is null!!!");
     35  return mInner->getPrivateContext();
     36 }
     37 
     38 txResultRecycler* txNodeSetContext::recycler() {
     39  NS_ASSERTION(mInner, "mInner is null!!!");
     40  return mInner->recycler();
     41 }
     42 
     43 void txNodeSetContext::receiveError(const nsAString& aMsg, nsresult aRes) {
     44  NS_ASSERTION(mInner, "mInner is null!!!");
     45 #ifdef DEBUG
     46  nsAutoString error(u"forwarded error: "_ns);
     47  error.Append(aMsg);
     48  mInner->receiveError(error, aRes);
     49 #else
     50  mInner->receiveError(aMsg, aRes);
     51 #endif
     52 }