This class holds information from GitHub about a release of a project.
More...
#include <tsGitHubRelease.h>
|
struct | Asset |
| Description of an "asset" of the release (typically a binary installer). More...
|
|
|
using | AssetList = std::list< Asset > |
| List of assets.
|
|
This class holds information from GitHub about a release of a project.
◆ GitHubRelease()
Constructor with download of the version information from GitHub.
Use isValid() to check if the download was successful.
- Parameters
-
[in] | owner | Project owner, either a GitHub user name or organization name. |
[in] | repository | Project repository name. |
[in] | tag | Git tag of the version to fetch. If empty, fetch the latest version. |
[in,out] | report | Where to report error. |
◆ isValid()
bool ts::GitHubRelease::isValid |
( |
| ) |
const |
|
inline |
Check if the content of this object is a valid release description.
- Returns
- True if this object is valid.
◆ downloadInfo()
Download the version information from GitHub.
- Parameters
-
[in] | owner | Project owner, either a GitHub user name or organization name. |
[in] | repository | Project repository name. |
[in] | tag | Git tag of the version to fetch. If empty, fetch the latest version. |
[in,out] | report | Where to report error. |
- Returns
- True on success, false on error.
◆ tag()
UString ts::GitHubRelease::tag |
( |
| ) |
const |
Get the Git tag name of the release.
- Returns
- The Git tag name.
◆ version()
UString ts::GitHubRelease::version |
( |
| ) |
const |
Get the version of the release.
- Returns
- The version. This is the tag without leading letters, following the convention that versions "3.1" is tagged as "v3.1" for instance.
◆ versionName()
UString ts::GitHubRelease::versionName |
( |
| ) |
const |
Get the version name of the release.
- Returns
- The version name.
◆ publishDate()
Time ts::GitHubRelease::publishDate |
( |
| ) |
const |
Get the publish date of the release.
- Returns
- The publish date.
◆ sourceTarURL()
UString ts::GitHubRelease::sourceTarURL |
( |
| ) |
const |
Get the URL of the source tarball (tgz file) for the release.
- Returns
- The URL.
◆ sourceZipURL()
UString ts::GitHubRelease::sourceZipURL |
( |
| ) |
const |
Get the URL of the source zip archive for the release.
- Returns
- The URL.
◆ sourceURL()
UString ts::GitHubRelease::sourceURL |
( |
| ) |
const |
Get the most appropriate URL of the source archive for the release.
On Windows, prefer zip files. On UNIX, prefer tarballs.
- Returns
- The URL.
◆ sourceFileName()
UString ts::GitHubRelease::sourceFileName |
( |
| ) |
const |
◆ assetDownloadCount()
int ts::GitHubRelease::assetDownloadCount |
( |
| ) |
const |
Get the number of downloads for the assets of the release.
- Returns
- The number of downloads for the assets.
◆ getAssets()
void ts::GitHubRelease::getAssets |
( |
AssetList & |
assets | ) |
const |
Get the list of all assets for the release.
- Parameters
-
[out] | assets | The returned list of assets. |
◆ getPlatformAssets()
void ts::GitHubRelease::getPlatformAssets |
( |
AssetList & |
assets | ) |
const |
Get the list of assets for the current platform.
- Parameters
-
[out] | assets | The returned list of assets. |
◆ IsPlatformAsset()
static bool ts::GitHubRelease::IsPlatformAsset |
( |
const UString & |
fileName | ) |
|
|
static |
Check if a binary file is appropriate for the current platform.
The check is based on various naming conventions.
- Parameters
-
[in] | fileName | Asset base file name (no directory). |
- Returns
- True is fileName seems appropriate for the local platform.
◆ GetAllVersions()
Download information from GitHub for all versions of a product.
- Parameters
-
[out] | versions | Returned vector of downloaded versions. |
[in] | owner | Project owner, either a GitHub user name or organization name. |
[in] | repository | Project repository name. |
[in,out] | report | Where to report error. |
- Returns
- True on success, false on error.
The documentation for this class was generated from the following file: