LCOV - code coverage report
Current view: top level - src/esys/repo/git - difffile_git.cpp (source / functions) Hit Total Coverage
Test: esysrepo_coverage.info Lines: 18 35 51.4 %
Date: 2026-08-01 10:43:40 Functions: 8 16 50.0 %

          Line data    Source code
       1             : /*!
       2             :  * \file esys/repo/git/difffile_git.cpp
       3             :  * \brief
       4             :  *
       5             :  * \cond
       6             :  * __legal_b__
       7             :  *
       8             :  * Copyright (c) 2020 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/difffile.h"
      20             : 
      21             : namespace esys::repo::git
      22             : {
      23             : 
      24          12 : DiffFile::DiffFile() = default;
      25             : 
      26          12 : DiffFile::~DiffFile() = default;
      27             : 
      28          12 : void DiffFile::set_id(const std::string &id)
      29             : {
      30          12 :     m_id = id;
      31          12 : }
      32             : 
      33           0 : std::string &DiffFile::get_id()
      34             : {
      35           0 :     return m_id;
      36             : }
      37             : 
      38           0 : const std::string &DiffFile::get_id() const
      39             : {
      40           0 :     return m_id;
      41             : }
      42             : 
      43          12 : void DiffFile::set_path(const std::string &path)
      44             : {
      45          12 :     m_path = path;
      46          12 : }
      47             : 
      48           6 : std::string &DiffFile::get_path()
      49             : {
      50           6 :     return m_path;
      51             : }
      52             : 
      53           0 : const std::string &DiffFile::get_path() const
      54             : {
      55           0 :     return m_path;
      56             : }
      57             : 
      58          12 : void DiffFile::set_size(uint64_t size)
      59             : {
      60          12 :     m_size = size;
      61          12 : }
      62             : 
      63           0 : uint64_t &DiffFile::get_size()
      64             : {
      65           0 :     return m_size;
      66             : }
      67             : 
      68           0 : uint64_t DiffFile::get_size() const
      69             : {
      70           0 :     return m_size;
      71             : }
      72             : 
      73          12 : void DiffFile::set_mode(FileMode mode)
      74             : {
      75          12 :     m_mode = mode;
      76          12 : }
      77             : 
      78           4 : FileMode DiffFile::get_mode() const
      79             : {
      80           4 :     return m_mode;
      81             : }
      82             : 
      83           0 : bool DiffFile::operator==(const DiffFile &other) const
      84             : {
      85           0 :     if (get_id() != other.get_id()) return false;
      86           0 :     if (get_path() != other.get_path()) return false;
      87           0 :     if (get_size() != other.get_size()) return false;
      88           0 :     if (get_mode() != other.get_mode()) return false;
      89             :     return true;
      90             : }
      91             : 
      92           0 : bool DiffFile::operator!=(const DiffFile &other) const
      93             : {
      94           0 :     return !operator==(other);
      95             : }
      96             : 
      97             : } // namespace esys::repo::git

Generated by: LCOV version 1.14