Enhancement - Duration

- Relocated util/formatSeconds and util/formatSecondsCompact into
  Duration object.
- Relocated unit tests.
- Upgraded Duration object to use seconds, not days.
- Enhanced Duration so that it can now parse '4 mins' etc.
This commit is contained in:
Paul Beckingham
2010-06-27 00:57:52 -04:00
parent 1f8f4c631d
commit 9477660e02
10 changed files with 600 additions and 584 deletions

View File

@@ -38,16 +38,20 @@ public:
Duration (const std::string&); // Parse
bool operator< (const Duration&);
bool operator> (const Duration&);
Duration& operator= (const Duration&);
~Duration (); // Destructor
operator time_t ();
operator std::string ();
std::string format () const;
std::string formatCompact () const;
bool valid (const std::string&) const;
void parse (const std::string&);
private:
time_t mDays;
time_t mSecs;
};
#endif