File size: 595 Bytes
2492322 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #ifndef MAMBA_CORE_TIMEREF_HPP
#define MAMBA_CORE_TIMEREF_HPP
#include <chrono>
#include <string>
namespace mamba::validation
{
/** Define a time reference.
* TUF 5.1 'Record fixed update start time'
* https://theupdateframework.github.io/specification/latest/#fix-time
*/
class TimeRef
{
public:
void set(const std::time_t& time);
void set_now();
std::string timestamp() const;
TimeRef(const std::time_t& time);
TimeRef();
~TimeRef() = default;
private:
std::time_t m_time_ref;
};
}
#endif
|