tor-browser

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

txCore.h (1006B)


      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 #ifndef __txCore_h__
      7 #define __txCore_h__
      8 
      9 #include "nsDebug.h"
     10 #include "nsISupportsImpl.h"
     11 #include "nsStringFwd.h"
     12 #include "nscore.h"
     13 
     14 class txObject {
     15 public:
     16  MOZ_COUNTED_DEFAULT_CTOR(txObject)
     17 
     18  /**
     19   * Deletes this txObject
     20   */
     21  MOZ_COUNTED_DTOR_VIRTUAL(txObject)
     22 };
     23 
     24 /**
     25 * Utility class for doubles
     26 */
     27 class txDouble {
     28 public:
     29  /**
     30   * Converts the value of the given double to a string, and appends
     31   * the result to the destination string.
     32   */
     33  static void toString(double aValue, nsAString& aDest);
     34 
     35  /**
     36   * Converts the given String to a double, if the string value does not
     37   * represent a double, NaN will be returned.
     38   */
     39  static double toDouble(const nsAString& aStr);
     40 };
     41 
     42 #endif