dom/xslt/xpath/txStringResult.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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/. */
     6 /**
     7  * StringResult
     8  * Represents a String as a Result of evaluating an Expr
     9 **/
    10 #include "txExprResult.h"
    12 /**
    13  * Default Constructor
    14 **/
    15 StringResult::StringResult(txResultRecycler* aRecycler)
    16     : txAExprResult(aRecycler)
    17 {
    18 }
    20 /**
    21  * Creates a new StringResult with the value of the given String parameter
    22  * @param str the String to use for initialization of this StringResult's value
    23 **/
    24 StringResult::StringResult(const nsAString& aValue, txResultRecycler* aRecycler)
    25     : txAExprResult(aRecycler), mValue(aValue)
    26 {
    27 }
    29 /*
    30  * Virtual Methods from ExprResult
    31 */
    33 short StringResult::getResultType() {
    34     return txAExprResult::STRING;
    35 } //-- getResultType
    37 void
    38 StringResult::stringValue(nsString& aResult)
    39 {
    40     aResult.Append(mValue);
    41 }
    43 const nsString*
    44 StringResult::stringValuePointer()
    45 {
    46     return &mValue;
    47 }
    49 bool StringResult::booleanValue() {
    50    return !mValue.IsEmpty();
    51 } //-- booleanValue
    53 double StringResult::numberValue() {
    54     return txDouble::toDouble(mValue);
    55 } //-- numberValue

mercurial