michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __txCore_h__ michael@0: #define __txCore_h__ michael@0: michael@0: #include "nscore.h" michael@0: #include "nsDebug.h" michael@0: #include "nsISupportsImpl.h" michael@0: michael@0: class nsAString; michael@0: michael@0: class txObject michael@0: { michael@0: public: michael@0: txObject() michael@0: { michael@0: MOZ_COUNT_CTOR(txObject); michael@0: } michael@0: michael@0: /** michael@0: * Deletes this txObject michael@0: */ michael@0: virtual ~txObject() michael@0: { michael@0: MOZ_COUNT_DTOR(txObject); michael@0: } michael@0: }; michael@0: michael@0: /** michael@0: * Utility class for doubles michael@0: */ michael@0: class txDouble michael@0: { michael@0: public: michael@0: /** michael@0: * Converts the value of the given double to a string, and appends michael@0: * the result to the destination string. michael@0: */ michael@0: static void toString(double aValue, nsAString& aDest); michael@0: michael@0: /** michael@0: * Converts the given String to a double, if the string value does not michael@0: * represent a double, NaN will be returned. michael@0: */ michael@0: static double toDouble(const nsAString& aStr); michael@0: }; michael@0: michael@0: #endif