diff --git a/src/Record.cpp b/src/Record.cpp index 45fe7d32a..df7977a6e 100644 --- a/src/Record.cpp +++ b/src/Record.cpp @@ -178,6 +178,16 @@ time_t Record::get_date (const std::string& name) const return 0; } +//////////////////////////////////////////////////////////////////////////////// +time_t Record::get_duration (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) { diff --git a/src/Record.h b/src/Record.h index 61586f47c..93fbc0820 100644 --- a/src/Record.h +++ b/src/Record.h @@ -51,6 +51,7 @@ public: int get_int (const std::string&) const; unsigned long get_ulong (const std::string&) const; time_t get_date (const std::string&) const; + time_t get_duration (const std::string&) const; void set (const std::string&, const std::string&); void set (const std::string&, int); void remove (const std::string&);