KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kigit_remote_url.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef KIGIT_REMOTE_URL_H
21#define KIGIT_REMOTE_URL_H
22
23#include <import_export.h>
24
25#include <wx/string.h>
26
27namespace KIGIT
28{
29
37
40{
41 wxString url;
42 wxString username;
43 wxString password;
44 wxString hostname;
45 int port = 0;
47};
48
50APIEXPORT REMOTE_URL ParseRemoteURL( const wxString& aURL );
51
54APIEXPORT wxString CredentialServer( const wxString& aUrl );
55
61APIEXPORT wxString CredentialRealm( const wxString& aUrl );
62
64APIEXPORT wxString StripEmbeddedUserinfo( const wxString& aText );
65
67APIEXPORT wxString DecodeServerText( const char* aData, size_t aLength );
68
73APIEXPORT wxString PrintableServerText( const wxString& aText );
74
75} // namespace KIGIT
76
77#endif // KIGIT_REMOTE_URL_H
#define APIEXPORT
Macros which export functions from a DLL/DSO.
wxString PrintableServerText(const wxString &aText)
Text a server sent, made safe to show by removing terminal escapes, control and bidi characters,...
wxString DecodeServerText(const char *aData, size_t aLength)
Bytes a server sent, as UTF-8 or, when they are not valid UTF-8, one character for each byte.
wxString CredentialServer(const wxString &aUrl)
The host and port aUrl reaches, as host[:port] without the scheme's default port.
wxString CredentialRealm(const wxString &aUrl)
The server an HTTP(S) credential for aUrl serves, as scheme://host[:port] with no user,...
REMOTE_URL ParseRemoteURL(const wxString &aURL)
Split a remote address the way libgit2 reads it, so a host key is checked against the host it dials.
wxString StripEmbeddedUserinfo(const wxString &aText)
Remove the user and password from every URL quoted in a message, since the remote's can carry a passw...
A transport address with any embedded credentials extracted.
wxString url
Keeps the SSH username, scheme and port, but never a password.
int port
0 when the address names none.
GIT_CONN_TYPE connType