Page MenuHomePhabricator (Chris)

GitHubAPI.h
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

GitHubAPI.h

#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

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)

Event Timeline