|
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. More... | |
| void | canceled () |
| Emitted if a operation has canceled. | |
| void | error (const QString &error) |
| Emitted on any error. More... | |
| void | progress (qint64 bytesReceived, qint64 bytesTotal) |
| Emitted while downloading. More... | |
Public Member Functions | |
| QGitHubReleaseAPI (const QUrl &apiUrl, TYPE type, bool multi=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QUrl &apiUrl, bool multi=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, TYPE type, bool latest=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, bool latest=true, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, const QString &tag, TYPE type, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, const QString &tag, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, const char *tag, TYPE type, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, const char *tag, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, int perPage, TYPE type, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QGitHubReleaseAPI (const QString &user, const QString &repo, int perPage, QObject *parent=0) | |
Creates an QGitHubReleaseAPI instance. More... | |
| QUrl | apiUrl () const |
| The api URL. More... | |
| QByteArray | asJsonData () const |
| Gets the release information as raw Json data. More... | |
| qint64 | downloadToFile (const QUrl &url, QFile &outputFile) const |
Downloads the file at QUrl into a file. More... | |
| QByteArray | downloadToMemory (const QUrl &url) const |
Downloads the file at QUrl into a QByteArray. More... | |
| int | entries () const |
| The number of entries received. More... | |
| QString | eTag () const |
| the eTag More... | |
| uint | rateLimit () const |
| uint | rateLimitRemaining () const |
| QDateTime | rateLimitReset () const |
| void | setETag (const QString &eTag) |
| Sets the eTag. More... | |
| QVariantList | toVariantList () const |
Gets the release information as QVariantList. More... | |
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. More... | |
| QImage | avatar (int idx=0) const |
Downloads the avatar and creates a QImage. More... | |
| QUrl | authorHtmlUrl (int idx=0) const |
| The URL to the author HTML site. More... | |
| ulong | authorId (int idx=0) const |
| the authorId More... | |
| QString | login (int idx=0) const |
| The login name of the author. More... | |
Static Public Member Functions | |
| static void | setUserAgent (const char *userAgent) |
| Sets an UserAgent. More... | |
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.
1.8.8