HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/miniconda3/Library/include/mamba/core/timeref.hpp
#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