Enhancement

- Implemented Record::get_date to eliminated the need to obtain a date
  as a string, then convert to time_t, then instantiate a Date.
This commit is contained in:
Paul Beckingham
2011-07-01 22:13:34 -04:00
parent 7d5f4fdfc7
commit 63f91c2f88
12 changed files with 54 additions and 42 deletions

View File

@@ -168,6 +168,16 @@ unsigned long Record::get_ulong (const std::string& name) const
return 0;
}
////////////////////////////////////////////////////////////////////////////////
time_t Record::get_date (const std::string& name) const
{
Record::const_iterator i = this->find (name);
if (i != this->end ())
return (time_t) strtoul (i->second.value ().c_str (), NULL, 10);
return 0;
}
////////////////////////////////////////////////////////////////////////////////
void Record::set (const std::string& name, const std::string& value)
{