Mania++
 All Classes Functions Variables Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
VersionChecker Class Reference

Checks Mania++ version (and possibly plugin versions). More...

#include <VersionChecker.h>

Public Member Functions

bool CheckForUpdates (std::string repository, std::string currentVersion)
 Returns whether there are updates available. More...
 

Private Member Functions

void retrieveData (std::string url, std::string *data)
 Retrieves data via cURL. More...
 
std::vector< GitVersionretrieveVersions (std::string repository)
 Retrieves versions (tags) of repository. More...
 
std::vector< GitVersiondecodeVersions (std::string response)
 Decodes the JSON response with versions (tags) of repository. More...
 
void retrieveRelease (GitVersion *version)
 Retrieves release information. More...
 
void decodeRelease (GitVersion *version, std::string response)
 Decodes the JSON response with release and inputs info into version struct. More...
 

Static Private Member Functions

static size_t receiveData (void *contents, size_t size, size_t nmemb, std::string *tags)
 Receives data from cURL input. More...
 

Detailed Description

Checks Mania++ version (and possibly plugin versions).

Member Function Documentation

bool VersionChecker::CheckForUpdates ( std::string  repository,
std::string  currentVersion 
)

Returns whether there are updates available.

Parameters
repositoryName of the GitHub repository.
currentVersionVersion to which the repository to.
void VersionChecker::decodeRelease ( GitVersion version,
std::string  response 
)
private

Decodes the JSON response with release and inputs info into version struct.

Parameters
versionVersion struct.
responseServer response (JSON).
std::vector< GitVersion > VersionChecker::decodeVersions ( std::string  response)
private

Decodes the JSON response with versions (tags) of repository.

Parameters
responseServer response (JSON).
size_t VersionChecker::receiveData ( void *  contents,
size_t  size,
size_t  nmemb,
std::string *  tags 
)
staticprivate

Receives data from cURL input.

Parameters
contentsContents from cURL.
sizeSize of contents.
nmembNumber of members (?).
tagsOutput string.
void VersionChecker::retrieveData ( std::string  url,
std::string *  data 
)
private

Retrieves data via cURL.

Parameters
urlURL to retrieve.
dataReceived data (return).
void VersionChecker::retrieveRelease ( GitVersion version)
private

Retrieves release information.

Parameters
versionVersion struct.
std::vector< GitVersion > VersionChecker::retrieveVersions ( std::string  repository)
private

Retrieves versions (tags) of repository.

Parameters
repositoryRepository name.

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