1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-770: extend VersionInfo class to include most of the info available

This commit is contained in:
Oleg Semyonov 2013-05-25 14:27:27 +02:00
parent 4b46251ff1
commit 4f6c633815
2 changed files with 114 additions and 6 deletions

View File

@ -27,22 +27,102 @@ VersionInfo::VersionInfo()
{
}
QString VersionInfo::origin()
{
return "${ORIGIN}";
}
QString VersionInfo::revision()
{
return "${REVISION}";
}
QString VersionInfo::hash()
{
return "${HASH}";
}
QString VersionInfo::uavoHashTxt()
{
return "${UAVOSHA1TXT}";
}
QString VersionInfo::uavoHash()
{
return "{ ${UAVOSHA1} }";
}
QString VersionInfo::label()
{
return "${LABEL}";
}
QString VersionInfo::tag()
{
return "${TAG}";
}
QString VersionInfo::tagOrBranch()
{
return "${TAG_OR_BRANCH}";
}
QString VersionInfo::tagOrHash8()
{
return "${TAG_OR_HASH8}";
}
QString VersionInfo::hash8()
{
return "${HASH8}";
}
QString VersionInfo::fwTag()
{
return "${FWTAG}";
}
QString VersionInfo::unixTime()
{
return "${UNIXTIME}";
}
QString VersionInfo::dateTime()
{
return "${DATETIME}";
}
QString VersionInfo::date()
{
return "${DATE}";
}
QString VersionInfo::day()
{
return "${DAY}";
}
QString VersionInfo::month()
{
return "${MONTH}";
}
QString VersionInfo::year()
{
return "${YEAR}";
}
QString VersionInfo::origin()
QString VersionInfo::hour()
{
return "${ORIGIN}";
return "${HOUR}";
}
QString VersionInfo::uavoHash()
QString VersionInfo::minute()
{
return "{ ${UAVOSHA1} }";
return "${MINUTE}";
}
QString VersionInfo::dirty()
{
return "${DIRTY}";
}

View File

@ -27,12 +27,40 @@
#include <QString>
/**
* @class VersionInfo
* @brief Library class to provide version info information extracted from a git repository.
*
* Class static members return read-only strings extracted from a git repository at compile time.
* The content is generated by the version-info.py utility using template.
*
* @note If repository or git utility is unavailable, strings can be empty or be "None".
* So do not assume they have some particular format when used, use them as strings only.
*
* More info: http://wiki.openpilot.org/display/Doc/Building+and+Packaging+Overview
*/
class VersionInfo {
public:
static QString revision();
static QString year();
static QString origin();
static QString revision();
static QString hash();
static QString uavoHashTxt();
static QString uavoHash();
static QString label();
static QString tag();
static QString tagOrBranch();
static QString tagOrHash8();
static QString hash8();
static QString fwTag();
static QString unixTime();
static QString dateTime();
static QString date();
static QString day();
static QString month();
static QString year();
static QString hour();
static QString minute();
static QString dirty();
private:
VersionInfo();
};