SoftwareVersion.h
#ifndef GPGFRONTEND_SOFTWAREVERSION_H
#define GPGFRONTEND_SOFTWAREVERSION_H
#include <boost/date_time.hpp>
namespace GpgFrontend::UI {
struct SoftwareVersion {
std::string latest_version;
std::string current_version;
bool latest_prerelease = false;
bool latest_draft = false;
bool current_prerelease = false;
bool current_draft = false;
bool load_info_done = false;
bool current_version_found = false;
std::string publish_date;
std::string release_note;
[[nodiscard]] bool InfoVaild() const { return load_info_done; }
[[nodiscard]] bool NeedUpgrade() const {
return load_info_done && !latest_prerelease && !latest_draft &&
current_version < latest_version;
}
[[nodiscard]] bool VersionWithDrawn() const {
return load_info_done && !current_version_found && current_prerelease &&
!current_draft;
}
[[nodiscard]] bool CurrentVersionReleased() const {
return load_info_done && current_version_found;
}
};
} // namespace GpgFrontend::UI
#endif // GPGFRONTEND_SOFTWAREVERSION_H
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::UI::SoftwareVersion
Definition: SoftwareVersion.h:39
GpgFrontend::UI::SoftwareVersion::VersionWithDrawn
bool VersionWithDrawn() const
Definition: SoftwareVersion.h:76
GpgFrontend::UI::SoftwareVersion::CurrentVersionReleased
bool CurrentVersionReleased() const
Definition: SoftwareVersion.h:87
GpgFrontend::UI::SoftwareVersion::NeedUpgrade
bool NeedUpgrade() const
Definition: SoftwareVersion.h:65
GpgFrontend::UI::SoftwareVersion::InfoVaild
bool InfoVaild() const
Definition: SoftwareVersion.h:57