tor-browser

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

txExpr.cpp (816B)


      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 "txExpr.h"
      7 
      8 nsresult Expr::evaluateToBool(txIEvalContext* aContext, bool& aResult) {
      9  RefPtr<txAExprResult> exprRes;
     10  nsresult rv = evaluate(aContext, getter_AddRefs(exprRes));
     11  NS_ENSURE_SUCCESS(rv, rv);
     12 
     13  aResult = exprRes->booleanValue();
     14 
     15  return NS_OK;
     16 }
     17 
     18 nsresult Expr::evaluateToString(txIEvalContext* aContext, nsString& aResult) {
     19  RefPtr<txAExprResult> exprRes;
     20  nsresult rv = evaluate(aContext, getter_AddRefs(exprRes));
     21  NS_ENSURE_SUCCESS(rv, rv);
     22 
     23  exprRes->stringValue(aResult);
     24 
     25  return NS_OK;
     26 }