Line data Source code
1 : /*! 2 : * \file esys/repo/tui/repostate.cpp 3 : * \brief 4 : * 5 : * \cond 6 : * __legal_b__ 7 : * 8 : * Copyright (c) 2026 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/tui/repostate.h" 20 : 21 : namespace esys::repo::tui 22 : { 23 : 24 2 : RepoState::RepoState() = default; 25 : 26 5 : RepoState::~RepoState() = default; 27 : 28 0 : void RepoState::set_name(const std::string &name) 29 : { 30 0 : m_name = name; 31 0 : } 32 : 33 0 : const std::string &RepoState::get_name() const 34 : { 35 0 : return m_name; 36 : } 37 : 38 0 : void RepoState::set_path(const std::string &path) 39 : { 40 0 : m_path = path; 41 0 : } 42 : 43 0 : const std::string &RepoState::get_path() const 44 : { 45 0 : return m_path; 46 : } 47 : 48 6 : void RepoState::set_status(RepoStatus status) 49 : { 50 6 : m_status = status; 51 6 : } 52 : 53 29 : RepoStatus RepoState::get_status() const 54 : { 55 29 : return m_status; 56 : } 57 : 58 4 : void RepoState::set_assigned_worker_id(std::optional<int> worker_id) 59 : { 60 4 : m_assigned_worker_id = worker_id; 61 4 : } 62 : 63 13 : std::optional<int> RepoState::get_assigned_worker_id() const 64 : { 65 13 : return m_assigned_worker_id; 66 : } 67 : 68 3 : void RepoState::set_progress(const progress::TransferCounters &progress) 69 : { 70 3 : m_progress = progress; 71 3 : } 72 : 73 0 : const progress::TransferCounters &RepoState::get_progress() const 74 : { 75 0 : return m_progress; 76 : } 77 : 78 11 : progress::TransferCounters &RepoState::get_progress() 79 : { 80 11 : return m_progress; 81 : } 82 : 83 6 : void RepoState::set_phase_text(const std::string &phase_text) 84 : { 85 6 : m_phase_text = phase_text; 86 6 : } 87 : 88 1 : const std::string &RepoState::get_phase_text() const 89 : { 90 1 : return m_phase_text; 91 : } 92 : 93 3 : void RepoState::set_detail_text(const std::string &detail_text) 94 : { 95 3 : m_detail_text = detail_text; 96 3 : } 97 : 98 1 : const std::string &RepoState::get_detail_text() const 99 : { 100 1 : return m_detail_text; 101 : } 102 : 103 5 : void RepoState::set_error_text(const std::string &error_text) 104 : { 105 5 : m_error_text = error_text; 106 5 : } 107 : 108 1 : const std::string &RepoState::get_error_text() const 109 : { 110 1 : return m_error_text; 111 : } 112 : 113 : } // namespace esys::repo::tui