Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F632504
GitHubAPI.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
GitHubAPI.h
View Options
#ifndef GITHUBAPI_H
#define GITHUBAPI_H
#include
<QImage>
#include
<QThread>
#include
<string>
#include
<functional>
#include
<memory>
class
WebContext
;
class
WebClient
;
class
GitHubAPI
{
public
:
typedef
std
::
shared_ptr
<
WebClient
>
WebClientPtr
;
struct
User
{
std
::
string
login
;
std
::
string
avatar_url
;
std
::
string
name
;
std
::
string
email
;
};
struct
SearchResultItem
{
std
::
string
full_name
;
std
::
string
description
;
std
::
string
ssh_url
;
std
::
string
clone_url
;
std
::
string
html_url
;
double
score
=
0
;
};
WebContext
*
webcx
;
GitHubAPI
(
WebContext
*
webcx
)
:
webcx
(
webcx
)
{
}
QList
<
GitHubAPI
::
SearchResultItem
>
searchRepository
(
const
std
::
string
&
q
);
};
class
GitHubRequestThread
:
public
QThread
{
private
:
struct
Private
;
Private
*
m
;
protected
:
void
run
();
public
:
GitHubAPI
::
WebClientPtr
web
();
public
:
GitHubRequestThread
();
~
GitHubRequestThread
();
std
::
string
url
;
bool
ok
=
false
;
std
::
string
text
;
std
::
function
<
bool
(
std
::
string
const
&
text
)
>
callback
;
void
start
(
WebContext
*
webcx
);
};
#endif
// GITHUBAPI_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Nov 15, 2:33 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124711
Default Alt Text
GitHubAPI.h (1 KB)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline