AusweisApp2/src/services/AppUpdateData.h

68 lines
1.3 KiB
C
Raw Normal View History

2017-07-03 09:33:28 +02:00
/*!
* \brief Update data implementation for application version.
*
2018-03-28 15:10:51 +02:00
* \copyright Copyright (c) 2016-2018 Governikus GmbH & Co. KG, Germany
2017-07-03 09:33:28 +02:00
*/
#pragma once
2017-12-20 14:54:05 +01:00
#include "GlobalStatus.h"
2017-07-03 09:33:28 +02:00
#include <QDateTime>
2017-12-20 14:54:05 +01:00
#include <QJsonObject>
2017-07-03 09:33:28 +02:00
#include <QString>
#include <QUrl>
namespace governikus
{
class AppUpdateData
{
private:
QDateTime mDate;
QString mVersion;
QUrl mUrl;
int mSize;
QUrl mChecksumUrl;
QUrl mNotesUrl;
QString mNotes;
2017-12-20 14:54:05 +01:00
GlobalStatus mParsingResult;
static bool checkPlatformObject(const QJsonObject& pJson);
static bool isPlatform(const QString& pPlatform);
2017-07-03 09:33:28 +02:00
public:
AppUpdateData();
2017-12-20 14:54:05 +01:00
AppUpdateData(GlobalStatus pParsingResult);
2017-07-03 09:33:28 +02:00
bool isValid() const;
const QDateTime getDate() const;
void setDate(const QDateTime& pDate);
const QString& getVersion() const;
void setVersion(const QString& pVersion);
const QUrl& getUrl() const;
void setUrl(const QUrl& pUrl);
int getSize() const;
void setSize(int pSize);
const QUrl& getChecksumUrl() const;
2017-12-20 14:54:05 +01:00
void setChecksumUrl(const QUrl& pChecksumUrl);
2017-07-03 09:33:28 +02:00
const QUrl& getNotesUrl() const;
2017-12-20 14:54:05 +01:00
void setNotesUrl(const QUrl& pNotesUrl);
2017-07-03 09:33:28 +02:00
const QString& getNotes() const;
void setNotes(const QString& pNotes);
2017-12-20 14:54:05 +01:00
const GlobalStatus& getParsingResult();
static AppUpdateData parse(const QByteArray& pData);
2017-07-03 09:33:28 +02:00
};
} /* namespace governikus */