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