Line data Source code
1 : /*! 2 : * \file esys/repo/git/status_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/status.h" 20 : 21 : namespace esys::repo::git 22 : { 23 : 24 6 : Status::Status() = default; 25 : 26 6 : Status::~Status() = default; 27 : 28 6 : void Status::set_type(StatusType type) 29 : { 30 6 : m_type = type; 31 6 : } 32 : 33 0 : StatusType Status::get_type() const 34 : { 35 0 : return m_type; 36 : } 37 : 38 22 : StatusType &Status::get_type() 39 : { 40 22 : return m_type; 41 : } 42 : 43 6 : void Status::set_sub_type(StatusSubType sub_type) 44 : { 45 6 : m_sub_type = sub_type; 46 6 : } 47 : 48 0 : StatusSubType Status::get_sub_type() const 49 : { 50 0 : return m_sub_type; 51 : } 52 : 53 4 : StatusSubType &Status::get_sub_type() 54 : { 55 4 : return m_sub_type; 56 : } 57 : 58 16 : DiffDelta &Status::get_diff_delta() 59 : { 60 16 : return m_diff_delta; 61 : } 62 : 63 0 : const DiffDelta &Status::get_diff_delta() const 64 : { 65 0 : return m_diff_delta; 66 : } 67 : 68 0 : bool Status::operator==(const Status &other) const 69 : { 70 0 : if (get_type() != other.get_type()) return false; 71 0 : if (get_sub_type() != other.get_sub_type()) return false; 72 0 : if (get_diff_delta() != other.get_diff_delta()) return false; 73 : return true; 74 : } 75 : 76 0 : bool Status::operator!=(const Status &other) const 77 : { 78 0 : return !operator==(other); 79 : } 80 : 81 : } // namespace esys::repo::git