LCOV - code coverage report
Current view: top level - src/esys/repo/git - note_git.cpp (source / functions) Hit Total Coverage
Test: esysrepo_coverage.info Lines: 16 33 48.5 %
Date: 2026-08-01 10:43:40 Functions: 8 14 57.1 %

          Line data    Source code
       1             : /*!
       2             :  * \file esys/repo/git/note_git.cpp
       3             :  * \brief
       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             : #include "esys/repo/esysrepo_prec.h"
      19             : #include "esys/repo/git/note.h"
      20             : 
      21             : namespace esys::repo::git
      22             : {
      23             : 
      24           5 : Note::Note() = default;
      25             : 
      26           5 : Note::~Note() = default;
      27             : 
      28           5 : void Note::set_message(const std::string &message)
      29             : {
      30           5 :     m_message = message;
      31           5 : }
      32             : 
      33           5 : const std::string &Note::get_message() const
      34             : {
      35           5 :     return m_message;
      36             : }
      37             : 
      38           0 : void Note::set_author(const Signature &author)
      39             : {
      40           0 :     m_author = author;
      41           0 : }
      42             : 
      43           0 : const Signature &Note::get_author() const
      44             : {
      45           0 :     return m_author;
      46             : }
      47             : 
      48          11 : Signature &Note::get_author()
      49             : {
      50          11 :     return m_author;
      51             : }
      52             : 
      53           0 : void Note::set_committer(const Signature &committer)
      54             : {
      55           0 :     m_committer = committer;
      56           0 : }
      57             : 
      58           0 : const Signature &Note::get_committer() const
      59             : {
      60           0 :     return m_committer;
      61             : }
      62             : 
      63          11 : Signature &Note::get_committer()
      64             : {
      65          11 :     return m_committer;
      66             : }
      67             : 
      68           5 : void Note::set_reference(const std::string &reference)
      69             : {
      70           5 :     m_reference = reference;
      71           5 : }
      72             : 
      73          15 : const std::string &Note::get_reference() const
      74             : {
      75          15 :     return m_reference;
      76             : }
      77             : 
      78           0 : bool Note::operator==(const Note &other) const
      79             : {
      80           0 :     if (get_message() != other.get_message()) return false;
      81           0 :     if (get_author() != other.get_author()) return false;
      82           0 :     if (get_committer() != other.get_committer()) return false;
      83           0 :     if (get_reference() != other.get_reference()) return false;
      84             :     return true;
      85             : }
      86             : 
      87           0 : bool Note::operator!=(const Note &other) const
      88             : {
      89           0 :     return !operator==(other);
      90             : }
      91             : 
      92             : } // namespace esys::repo::git

Generated by: LCOV version 1.14