KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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
22{
23public:
24 KIGIT_REPO_MIXIN( KIGIT_COMMON* aCommon ) : m_common( aCommon )
25 {
26 // Ensure m_common is initialized
27 wxASSERT( aCommon != nullptr );
28 }
29
31 {
32 // Non-owning, don't delete
33 }
34
39 wxString GetCurrentBranchName() const
40 {
42 }
43
48 std::vector<wxString> GetBranchNames() const
49 {
50 return m_common->GetBranchNames();
51 }
52
57 std::vector<wxString> GetProjectDirs()
58 {
59 return m_common->GetProjectDirs();
60 }
61
66 git_repository* GetRepo() const
67 {
68 return m_common->GetRepo();
69 }
70
75 std::pair<std::set<wxString>, std::set<wxString>> GetDifferentFiles() const
76 {
78 }
79
86 {
87 return m_common;
88 }
89
94
100 {
101 return m_common->GetNextPublicKey();
102 }
103
109 {
110 return m_common->GetConnType();
111 }
112
117 wxString GetUsername() const
118 {
119 return m_common->GetUsername();
120 }
121
126 wxString GetPassword() const
127 {
128 return m_common->GetPassword();
129 }
130
135 void SetUsername( const wxString& aUsername )
136 {
137 m_common->SetUsername( aUsername );
138 }
139
144 void SetPassword( const wxString& aPassword )
145 {
146 m_common->SetPassword( aPassword );
147 }
148
153 void SetSSHKey( const wxString& aSSHKey )
154 {
155 m_common->SetSSHKey( aSSHKey );
156 }
157
162 wxString GetRemotename() const
163 {
164 return m_common->GetRemotename();
165 }
166
171 wxString GetGitRootDirectory() const
172 {
174 }
175
180 unsigned& TestedTypes() { return m_common->TestedTypes(); }
181
182
183private:
185};
186
187
188#endif // GIT_REPO_MIXIN_H
std::vector< wxString > GetBranchNames() const
GIT_CONN_TYPE GetConnType() const
wxString GetCurrentBranchName() const
wxString GetGitRootDirectory() const
void SetSSHKey(const wxString &aSSHKey)
void SetUsername(const wxString &aUsername)
std::vector< wxString > GetProjectDirs()
Return a vector of project files in the repository.
wxString GetPassword() const
git_repository * GetRepo() const
wxString GetNextPublicKey()
std::pair< std::set< wxString >, std::set< wxString > > GetDifferentFiles() const
Return a pair of sets of files that differ locally from the remote repository The first set is files ...
wxString GetUsername() const
unsigned & TestedTypes()
void SetPassword(const wxString &aPassword)
wxString GetRemotename() const
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.