From aa63b1842ce03c992bd695c4dd7d3d940bf47f64 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 15 Nov 2001 00:49:20 +0000 Subject: Added construction from double to SString. Added ElapsedTime class to Platform. --- include/Platform.h | 7 +++++++ include/SString.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/include/Platform.h b/include/Platform.h index 5281260c4..fc0e1fe79 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -386,6 +386,13 @@ public: void Show(Point pt, Window &w); }; +class ElapsedTime { + double beginTime; +public: + ElapsedTime(); + double Duration(bool reset=false); +}; + /** * Platform class used to retrieve system wide parameters such as double click speed * and chrome colour. Not a creatable object, more of a module with several functions. diff --git a/include/SString.h b/include/SString.h index 199d144b5..ff97c0c76 100644 --- a/include/SString.h +++ b/include/SString.h @@ -91,6 +91,12 @@ public: s = StringDup(number); sSize = sLen = (s) ? strlen(s) : 0; } + SString(double d) : sizeGrowth(sizeGrowthDefault) { + char number[32]; + sprintf(number, "%.6f", d); + s = StringDup(number); + sSize = sLen = (s) ? strlen(s) : 0; + } ~SString() { delete []s; s = 0; -- cgit v1.2.3