TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::GitHubRelease Class Reference

#include <tsGitHubRelease.h>

Classes

struct  Asset

Public Types

using AssetList = std::list<Asset>

Public Member Functions

 GitHubRelease ()=default
 GitHubRelease (const UString &owner, const UString &repository, const UString &tag=UString(), Report &report=(ts::CerrReport::Instance()))
int assetDownloadCount () const
bool downloadInfo (const UString &owner, const UString &repository, const UString &tag=UString(), Report &report=(ts::CerrReport::Instance()))
void getAssets (AssetList &assets) const
void getPlatformAssets (AssetList &assets) const
bool isValid () const
Time publishDate () const
UString sourceFileName () const
UString sourceTarURL () const
UString sourceURL () const
UString sourceZipURL () const
UString tag () const
UString version () const
UString versionName () const

Static Public Member Functions

static bool GetAllVersions (GitHubReleaseVector &versions, const UString &owner, const UString &repository, Report &report=(ts::CerrReport::Instance()))
static bool IsPlatformAsset (const UString &fileName)

Detailed Description

This class holds information from GitHub about a release of a project.

Member Typedef Documentation

◆ AssetList

using ts::GitHubRelease::AssetList = std::list<Asset>

List of assets.

Constructor & Destructor Documentation

◆ GitHubRelease() [1/2]

ts::GitHubRelease::GitHubRelease ( )
default

Default constructor.

◆ GitHubRelease() [2/2]

ts::GitHubRelease::GitHubRelease ( const UString & owner,
const UString & repository,
const UString & tag = UString(),
Report & report = (ts::CerrReport::Instance()) )

Constructor with download of the version information from GitHub. Use isValid() to check if the download was successful.

Parameters
[in]ownerProject owner, either a GitHub user name or organization name.
[in]repositoryProject repository name.
[in]tagGit tag of the version to fetch. If empty, fetch the latest version.
[in,out]reportWhere to report error.

Member Function Documentation

◆ 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()

bool ts::GitHubRelease::downloadInfo ( const UString & owner,
const UString & repository,
const UString & tag = UString(),
Report & report = (ts::CerrReport::Instance()) )

Download the version information from GitHub.

Parameters
[in]ownerProject owner, either a GitHub user name or organization name.
[in]repositoryProject repository name.
[in]tagGit tag of the version to fetch. If empty, fetch the latest version.
[in,out]reportWhere 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

Get an appropriate file name to download sourceURL().

Returns
The local file name.
See also
sourceURL()

◆ 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]assetsThe returned list of assets.

◆ getPlatformAssets()

void ts::GitHubRelease::getPlatformAssets ( AssetList & assets) const

Get the list of assets for the current platform.

Parameters
[out]assetsThe returned list of assets.

◆ IsPlatformAsset()

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]fileNameAsset base file name (no directory).
Returns
True is fileName seems appropriate for the local platform.

◆ GetAllVersions()

bool ts::GitHubRelease::GetAllVersions ( GitHubReleaseVector & versions,
const UString & owner,
const UString & repository,
Report & report = (ts::CerrReport::Instance()) )
static

Download information from GitHub for all versions of a product.

Parameters
[out]versionsReturned vector of downloaded versions.
[in]ownerProject owner, either a GitHub user name or organization name.
[in]repositoryProject repository name.
[in,out]reportWhere to report error.
Returns
True on success, false on error.

The documentation for this class was generated from the following file: