QGitHubReleaseAPI
0.7
Qt library to receive release information from the GitHub API
|
The QGitHubReleaseAPI
class.
More...
Public Types | |
enum | TYPE { RAW, TEXT, HTML } |
Type of body. More... |
Public Slots | |
void | cancel () |
Cancels the current operation. |
Signals | |
void | available (const QGitHubReleaseAPI &api) |
Emitted if the release data is available. | |
void | canceled () |
Emitted if a operation has canceled. | |
void | error (const QString &error) |
Emitted on any error. | |
void | progress (qint64 bytesReceived, qint64 bytesTotal) |
Emitted while downloading. |
Public Member Functions | |
QGitHubReleaseAPI (const QUrl &apiUrl, TYPE type, bool multi=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QUrl &apiUrl, bool multi=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, TYPE type, bool latest=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, bool latest=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, const QString &tag, TYPE type, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, const QString &tag, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, const char *tag, TYPE type, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, const char *tag, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, int perPage, TYPE type, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QGitHubReleaseAPI (const QString &user, const QString &repo, int perPage, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. | |
QUrl | apiUrl () const |
The api URL. | |
QByteArray | asJsonData () const |
Gets the release information as raw Json data. | |
qint64 | downloadToFile (const QUrl &url, QFile &outputFile) const |
Downloads the file at QUrl into a file. | |
QByteArray | downloadToMemory (const QUrl &url) const |
Downloads the file at QUrl into a QByteArray . | |
int | entries () const |
The number of entries received. | |
QString | eTag () const |
the eTag | |
uint | rateLimit () const |
uint | rateLimitRemaining () const |
QDateTime | rateLimitReset () const |
void | setETag (const QString &eTag) |
Sets the eTag. | |
QVariantList | toVariantList () const |
Gets the release information as QVariantList . | |
Accessing the release information | |
ulong | releaseId (int idx=0) const |
QUrl | releaseUrl (int idx=0) const |
QUrl | assetsUrl (int idx=0) const |
QUrl | uploadUrl (int idx=0) const |
QUrl | releaseHtmlUrl (int idx=0) const |
QString | name (int idx=0) const |
QString | body (int idx=0) const |
QString | tagName (int idx=0) const |
QDateTime | publishedAt (int idx=0) const |
QDateTime | createdAt (int idx=0) const |
QUrl | tarBallUrl (int idx=0) const |
QUrl | zipBallUrl (int idx=0) const |
QByteArray | tarBall (int idx=0) const |
qint64 | tarBall (QFile &outputFile, int idx=0) const |
QByteArray | zipBall (int idx=0) const |
qint64 | zipBall (QFile &outputFile, int idx=0) const |
QString | targetCommitish (int idx=0) const |
bool | isDraft (int idx=0) const |
bool | isPreRelease (int idx=0) const |
Accessing the user information | |
QUrl | avatarUrl (int idx=0) const |
The URL to the avatar. | |
QImage | avatar (int idx=0) const |
Downloads the avatar and creates a QImage . | |
QUrl | authorHtmlUrl (int idx=0) const |
The URL to the author HTML site. | |
ulong | authorId (int idx=0) const |
the authorId | |
QString | login (int idx=0) const |
The login name of the author. |
Static Public Member Functions | |
static void | setUserAgent (const char *userAgent) |
Sets an UserAgent. |
Properties | |
QUrl | apiUrl |
the apiUrl | |
QUrl | assetsUrl |
the assetsUrl | |
QUrl | authorHtmlUrl |
the authorHtmlUrl | |
ulong | authorId |
the authorId | |
QImage | avatar |
the avatatr as QImage | |
QUrl | avatarUrl |
the avatarUrl | |
QString | body |
the release body | |
QDateTime | createdAt |
the date of creation | |
bool | draft |
true if the release is a draft, false otherwise | |
int | entries |
the number of entries | |
QString | eTag |
the eTag | |
QString | login |
the author login | |
QString | name |
the release name | |
bool | prerelease |
true if pre-release, false otherwise | |
QDateTime | publishedAt |
the date of publishing | |
uint | rateLimit |
the current rateLimit | |
uint | rateLimitRemaining |
the remaining rateLimit | |
QDateTime | rateLimitReset |
the date the rate limit resets | |
QUrl | releaseHtmlUrl |
the releaseHtmlUrl | |
ulong | releaseId |
the releaseId | |
QUrl | releaseUrl |
the releaseUrl | |
QString | tagName |
the release tag name | |
QByteArray | tarBall |
the tarBall as QByteArray | |
QUrl | tarBallUrl |
the tarBallUrl | |
QString | targetCommitish |
the targetCommitish (branch) | |
QUrl | uploadUrl |
the uploadUrl | |
QByteArray | zipBall |
the zipBall as QByteArray | |
QUrl | zipBallUrl |
the zipBallUrl |
The QGitHubReleaseAPI
class.
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QUrl & | apiUrl, |
TYPE | type, | ||
bool | multi = true , |
||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
apiUrl | direct URL to retrieve |
type | the type of the body |
multi | true if multiple results are expected, false otherwise |
|
explicit |
Creates an QGitHubReleaseAPI
instance.
apiUrl | direct URL to retrieve |
multi | true if multiple results are expected, false otherwise |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
TYPE | type, | ||
bool | latest = true , |
||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
type | the type of the body |
latest | true to only retrieve the latest release, false for all releases |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
bool | latest = true , |
||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
latest | true to only retrieve the latest release, false for all releases |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
const QString & | tag, | ||
TYPE | type, | ||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
tag | the release tag to retrieve |
type | the type of the body |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
const QString & | tag, | ||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
tag | the release tag to retrieve |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
const char * | tag, | ||
TYPE | type, | ||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
tag | the release tag to retrieve |
type | the type of the body |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
const char * | tag, | ||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
tag | the release tag to retrieve |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
int | perPage, | ||
TYPE | type, | ||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
perPage | the amount of releases to retrieve |
type | the type of the body |
QGitHubReleaseAPI::QGitHubReleaseAPI | ( | const QString & | user, |
const QString & | repo, | ||
int | perPage, | ||
QObject * | parent = 0 |
||
) |
Creates an QGitHubReleaseAPI
instance.
user | the GitHub user (aka login) |
repo | the repository to retrieve release information for |
perPage | the amount of releases to retrieve |
QUrl QGitHubReleaseAPI::apiUrl | ( | ) | const |
The api URL.
QByteArray QGitHubReleaseAPI::asJsonData | ( | ) | const |
Gets the release information as raw Json data.
QUrl QGitHubReleaseAPI::authorHtmlUrl | ( | int | idx = 0 | ) | const |
The URL to the author HTML site.
idx | the entry index |
ulong QGitHubReleaseAPI::authorId | ( | int | idx = 0 | ) | const |
the authorId
idx | the entry index |
|
signal |
Emitted if the release data is available.
api | reference to the QGitHubReleaseAPI |
QImage QGitHubReleaseAPI::avatar | ( | int | idx = 0 | ) | const |
Downloads the avatar and creates a QImage
.
idx | the entry index |
NULL
QImage on failure QUrl QGitHubReleaseAPI::avatarUrl | ( | int | idx = 0 | ) | const |
The URL to the avatar.
idx | the entry index |
qint64 QGitHubReleaseAPI::downloadToFile | ( | const QUrl & | url, |
QFile & | outputFile | ||
) | const |
Downloads the file at QUrl
into a file.
url | the URL to download from |
outputFile | the file to download to |
QByteArray QGitHubReleaseAPI::downloadToMemory | ( | const QUrl & | url | ) | const |
Downloads the file at QUrl
into a QByteArray
.
url | the URL to download from |
QByteArray
containing the downloaded file int QGitHubReleaseAPI::entries | ( | ) | const |
The number of entries received.
|
signal |
Emitted on any error.
error | the error string |
QString QGitHubReleaseAPI::eTag | ( | ) | const |
the eTag
An eTag, if known, can get used to avoid using the rate limit
QString QGitHubReleaseAPI::login | ( | int | idx = 0 | ) | const |
The login name of the author.
idx | the entry index |
|
signal |
Emitted while downloading.
bytesTotal
is -1
if the number of total bytes is not available
bytesReceived
is equal to bytesTotal
if the download has finished
bytesReceived | the number of bytes received |
bytesTotal | the number of total bytes |
void QGitHubReleaseAPI::setETag | ( | const QString & | eTag | ) |
Sets the eTag.
An eTag, if known, can get used to avoid using the rate limit
eTag | the eTag |
|
static |
Sets an UserAgent.
userAgent | an UserAgent |
QVariantList QGitHubReleaseAPI::toVariantList | ( | ) | const |
Gets the release information as QVariantList
.