Line data Source code
1 : /*! 2 : * \file esys/repo/git/remote_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/remote.h" 20 : 21 : namespace esys::repo::git 22 : { 23 : 24 73 : Remote::Remote() = default; 25 : 26 141 : Remote::~Remote() = default; 27 : 28 71 : void Remote::set_name(const std::string &name) 29 : { 30 71 : m_name = name; 31 71 : } 32 : 33 135 : const std::string &Remote::get_name() const 34 : { 35 135 : return m_name; 36 : } 37 : 38 71 : void Remote::set_url(const std::string &url) 39 : { 40 71 : m_url = url; 41 71 : } 42 : 43 6 : const std::string &Remote::get_url() const 44 : { 45 6 : return m_url; 46 : } 47 : 48 0 : bool Remote::operator==(const Remote &other) const 49 : { 50 0 : if (get_name() != other.get_name()) return false; 51 0 : if (get_url() != other.get_url()) return false; 52 : return true; 53 : } 54 : 55 0 : bool Remote::operator!=(const Remote &other) const 56 : { 57 0 : return !operator==(other); 58 : } 59 : 60 : } // namespace esys::repo::git 61 : 62 : namespace std 63 : { 64 : 65 0 : ESYSREPO_API ostream &operator<<(ostream &os, const esys::repo::git::Remote &remote) 66 : { 67 0 : os << "name : " << remote.get_name() << std::endl; 68 0 : os << "url : " << remote.get_url(); 69 0 : return os; 70 : } 71 : 72 : } // namespace std