Line data Source code
1 : /*! 2 : * \file esys/repo/git/signature.h 3 : * \brief Class to hold all information of a Git signature 4 : * 5 : * \cond 6 : * __legal_b__ 7 : * 8 : * Copyright (c) 2023 Michel Gillet 9 : * Distributed under the MIT License. 10 : * (See accompanying file LICENSE.txt or 11 : * copy at https://opensource.org/licenses/MIT) 12 : * 13 : * __legal_e__ 14 : * \endcond 15 : * 16 : */ 17 : 18 : #pragma once 19 : 20 : #include "esys/repo/esysrepo_defs.h" 21 : #include "esys/repo/git/person.h" 22 : 23 : #include <chrono> 24 : #include <string> 25 : 26 : //<swig_inc/> 27 : 28 : namespace esys::repo::git 29 : { 30 : 31 : /*! \class Signature esys/repo/git/signature.h "esys/repo/git/signature.h" 32 : * \brief Class to hold all information of a Git signature 33 : */ 34 0 : class ESYSREPO_API Signature: public Person 35 : { 36 : public: 37 : //! Default constructor 38 : Signature(); 39 : 40 : //! Destructor 41 : ~Signature(); 42 : 43 : //! Set the date and time 44 : /*! 45 : * \param[in] date_time the date and time 46 : */ 47 : void set_date_time(const std::chrono::system_clock::time_point &date_time); 48 : 49 : //! Get the date and time 50 : /*! 51 : * \return the date and time 52 : */ 53 : const std::chrono::system_clock::time_point &get_date_time() const; 54 : 55 : //! Set the offset 56 : /*! 57 : * \param[in] offset the offset 58 : */ 59 : void set_offset(int offset); 60 : 61 : //! Get the offset 62 : /*! 63 : * \return the offset 64 : */ 65 : int get_offset() const; 66 : 67 : //! Equal to comparison operator 68 : bool operator==(const Signature &other) const; 69 : 70 : //! Not equal to comparison operator 71 : bool operator!=(const Signature &other) const; 72 : 73 : private: 74 : //!< \cond DOXY_IMPL 75 : std::chrono::system_clock::time_point m_date_time; //!< The date & time 76 : int m_offset = 0; //!< The offest 77 : //!< \endcond 78 : }; 79 : 80 : } // namespace esys::repo::git