Enhancement/Fixes - Duration

- Reorganized Duration::valid and Duration::parse to use the same list
  of supported constructs.
- Added missing copy constructor.
- Added missing ctor initializer list.
- Corrected handling of negative time_t values.
- Added support for more duration formats.
- Corrected autoComplete use.
- Added Duration::negative.
- Corrected unit test descriptions.
This commit is contained in:
Paul Beckingham
2010-07-25 22:05:02 -04:00
parent cb4fe4fffb
commit 123a46eef9
4 changed files with 313 additions and 285 deletions

View File

@@ -34,7 +34,8 @@ class Duration
{
public:
Duration (); // Default constructor
Duration (time_t); // Default constructor
Duration (const Duration&); // Copy constructor
Duration (time_t); // Constructor
Duration (const std::string&); // Parse
bool operator< (const Duration&);
bool operator> (const Duration&);
@@ -47,6 +48,7 @@ public:
std::string format () const;
std::string formatCompact () const;
bool negative () const;
bool valid (const std::string&) const;
void parse (const std::string&);