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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user