KiCad PCB EDA Suite
Loading...
Searching...
No Matches
git_repo_mixin.h
Go to the documentation of this file.
1// This program is free software; you can redistribute it and/or modify
2// it under the terms of the GNU General Public License as published by
3// the Free Software Foundation; either version 3 of the License, or
4// (at your option) any later version.
5//
6// This program is distributed in the hope that it will be useful,
7// but WITHOUT ANY WARRANTY; without even the implied warranty of
8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9// GNU General Public License for more details.
10//
11// You should have received a copy of the GNU General Public License
12// along with this program; if not, see <http://www.gnu.org/licenses/>.
13
14#ifndef GIT_REPO_MIXIN_H
15#define GIT_REPO_MIXIN_H
16
17#include "kicad_git_common.h"
18#include "kicad_git_errors.h"
19#include "git_progress.h"
20#include <import_export.h>
21
23{
24public:
25 KIGIT_REPO_MIXIN( KIGIT_COMMON* aCommon ) : m_common( aCommon )
26 {
27 // Ensure m_common is initialized
28 wxASSERT( aCommon != nullptr );
29 }
30
32 {
33 // Non-owning, don't delete
34 }
35
40 wxString GetCurrentBranchName() const
41 {
42 return m_common->GetCurrentBranchName();
43 }
44
49 std::vector<wxString> GetBranchNames() const
50 {
51 return m_common->GetBranchNames();
52 }
53
58 std::vector<wxString> GetProjectDirs()
59 {
60 return m_common->GetProjectDirs();
61 }
62
67 git_repository* GetRepo() const
68 {
69 return m_common->GetRepo();
70 }
71
76 std::pair<std::set<wxString>, std::set<wxString>> GetDifferentFiles() const
77 {
78 return m_common->GetDifferentFiles();
79 }
80
85
87 {
88 return m_common;
89 }
90
94 void ResetNextKey() { m_common->ResetNextKey(); }
95
101 {
102 return m_common->GetNextPublicKey();
103 }
104
110 {
111 return m_common->GetConnType();
112 }
113
118 wxString GetUsername() const
119 {
120 return m_common->GetUsername();
121 }
122
127 wxString GetPassword() const
128 {
129 return m_common->GetPassword();
130 }
131
136 void SetUsername( const wxString& aUsername )
137 {
138 m_common->SetUsername( aUsername );
139 }
140
145 void SetPassword( const wxString& aPassword )
146 {
147 m_common->SetPassword( aPassword );
148 }
149
154 void SetSSHKey( const wxString& aSSHKey )
155 {
156 m_common->SetSSHKey( aSSHKey );
157 }
158
163 wxString GetRemotename() const
164 {
165 return m_common->GetRemotename();
166 }
167
172 wxString GetGitRootDirectory() const
173 {
174 return m_common->GetGitRootDirectory();
175 }
176
181 unsigned& TestedTypes() { return m_common->TestedTypes(); }
182
183
184private:
186};
187
188
189#endif // GIT_REPO_MIXIN_H
GIT_PROGRESS(wxWindow *aParent, int aMaxValue1, int aMaxValue2)
KIGIT_ERRORS()=default
wxString GetCurrentBranchName() const
Get the current branch name.
void SetPassword(const wxString &aPassword)
Set the password.
std::pair< std::set< wxString >, std::set< wxString > > GetDifferentFiles() const
Get a pair of sets of files that differ locally from the remote repository.
std::vector< wxString > GetProjectDirs()
Get a list of project directories.
wxString GetPassword() const
Get the password.
git_repository * GetRepo() const
Get a pointer to the git repository.
void SetUsername(const wxString &aUsername)
Set the username.
std::vector< wxString > GetBranchNames() const
Get a list of branch names.
KIGIT_COMMON * m_common
virtual ~KIGIT_REPO_MIXIN()
wxString GetUsername() const
Get the username.
wxString GetNextPublicKey()
Get the next public key.
wxString GetGitRootDirectory() const
Get the git root directory.
unsigned & TestedTypes()
Return the connection types that have been tested for authentication.
KIGIT_COMMON * GetCommon() const
Get the common object.
KIGIT_REPO_MIXIN(KIGIT_COMMON *aCommon)
KIGIT_COMMON::GIT_CONN_TYPE GetConnType() const
Get the connection type.
void SetSSHKey(const wxString &aSSHKey)
Set the SSH key.
wxString GetRemotename() const
Get the remote name.
void ResetNextKey()
Reset the next public key to test.
#define APIEXPORT
Macros which export functions from a DLL/DSO.