|
swift
|
Artifacts ("our software" products). More...
#include <artifact.h>
Public Types | |
| enum | ColumnIndex { IndexName = CPropertyIndexRef::GlobalIndexCArtifact , IndexMd5 , IndexType , IndexPlatform , IndexVersionString , IndexQVersion , IndexSize , IndexSizeHumanReadable , IndexDistributions } |
| Properties by index. More... | |
| enum | ArtifactType { UnknownArtifact , PilotClientInstaller , Symbols , XSwiftBus } |
| Type. More... | |
| Public Types inherited from swift::misc::CValueObject< CArtifact > | |
| using | base_type |
| Base class. | |
| Public Types inherited from swift::misc::CEmpty | |
| using | base_type = CEmpty |
| Base class is alias of itself. | |
| Public Types inherited from swift::misc::mixin::Index< CArtifact > | |
| enum | ColumnIndex |
| Base class enums. More... | |
| Public Types inherited from swift::misc::db::IDatastoreObjectWithIntegerKey | |
| enum | ColumnIndex { IndexDbIntegerKey = CPropertyIndexRef::GlobalIndexIDatastoreInteger , IndexDbKeyAsString , IndexIsLoadedFromDb , IndexDatabaseIcon , IndexVersion , IndexEndMarker } |
| Property index. More... | |
| Public Types inherited from swift::misc::ITimestampBased | |
| enum | ColumnIndex { IndexUtcTimestamp = CPropertyIndexRef::GlobalIndexITimestampBased , IndexUtcTimestampFormattedYmdhms , IndexUtcTimestampFormattedYmdhmsz , IndexUtcTimestampFormattedMdhms , IndexUtcTimestampFormattedMdhmsz , IndexUtcTimestampFormattedDhms , IndexUtcTimestampFormattedHms , IndexUtcTimestampFormattedHm , IndexMSecsSinceEpoch } |
| Properties by index. More... | |
Public Member Functions | |
| CArtifact ()=default | |
| Default constructor. | |
| CArtifact (const QString &name, const QString &version, const QString &md5, ArtifactType type, int size, bool existing, const CPlatform &platform) | |
| Constructor. | |
| bool | hasName () const |
| Having name? | |
| const QString & | getName () const |
| Name (i.e. installer name, symbol name). | |
| void | setName (const QString &name) |
| Set the name. | |
| bool | matchesName (const QString &name, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
| Matching name? | |
| ArtifactType | getType () const |
| Get type. | |
| bool | isUnknown () const |
| Unknown. | |
| void | setType (ArtifactType type) |
| Set type. | |
| int | getFileSize () const |
| File size. | |
| QString | getFileSizeHumanReadable () const |
| Human readable (GB, MB, ..) file size. | |
| void | setFileSize (int size) |
| Set file size. | |
| const QString & | getMd5 () const |
| MD5. | |
| const CPlatform & | getPlatform () const |
| OS. | |
| bool | matchesAnyPlatform (const CPlatform &platform) const |
| Matches any platform. | |
| void | setPlatform (const CPlatform &platform) |
| Set the OS. | |
| const CDistributionList & | getDistributions () const |
| Related distributions. | |
| CDistribution | getMostStableDistribution () const |
| Most stable distribution if any. | |
| void | setDistributions (const CDistributionList &distributions) |
| Related distributions. | |
| bool | hasDistributions () const |
| Has distributions? | |
| bool | hasUnrestrictedDistribution () const |
| Has unrestricted distribution. | |
| bool | isWithDistribution (const CDistribution &distribution, bool acceptMoreStableDistributions) const |
| Is distributed with given distribution? | |
| network::CRemoteFile | asRemoteFile () const |
| Turn into remote file. | |
| bool | isNewerThanCurrentBuild () const |
| Newer than the current build. | |
| QString | convertToQString (bool i18n=false) const |
| Cast as QString. | |
| QString | convertToQString (const QString &separator, bool i18n=false) const |
| To string. | |
| QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| Public Member Functions inherited from swift::misc::mixin::MetaType< CArtifact > | |
| int | getMetaTypeId () const |
| Returns the Qt meta type ID of this object. | |
| QString | getClassName () const |
| Class name. | |
| bool | isA (int metaTypeId) const |
| Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. | |
| Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< CArtifact > | |
| void | marshallToDbus (QDBusArgument &arg, Tags...) const |
| Marshall without begin/endStructure, for when composed within another object. | |
| void | unmarshallFromDbus (const QDBusArgument &arg, Tags...) |
| Unmarshall without begin/endStructure, for when composed within another object. | |
| Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CArtifact > | |
| void | marshalToDataStream (QDataStream &stream) const |
| Marshal a value to a QDataStream. | |
| void | unmarshalFromDataStream (QDataStream &stream) |
| Unmarshal a value from a QDataStream. | |
| Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CArtifact > | |
| QJsonObject | toJson () const |
| Cast to JSON object. | |
| QString | toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const |
| Convenience function JSON as string. | |
| void | convertFromJson (const QJsonObject &json) |
| Assign from JSON object. | |
| Public Member Functions inherited from swift::misc::mixin::String< CArtifact > | |
| QString | toQString (bool i18n=false) const |
| Cast as QString. | |
| std::string | toStdString (bool i18n=false) const |
| To std string. | |
| QString | stringForStreaming () const |
| String for streaming operators. | |
| Public Member Functions inherited from swift::misc::mixin::Index< CArtifact > | |
| CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
| Update by variant map. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CArtifact &compareValue) const |
| Compare for index. | |
| bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
| Is given variant equal to value of property index? | |
| Public Member Functions inherited from swift::misc::mixin::Icon< CArtifact > | |
| CIcons::CIcons::StandardIconUnknown16 | toIcon () const |
| As icon, not implemented by all classes. | |
| Public Member Functions inherited from swift::misc::db::IDatastoreObjectWithIntegerKey | |
| int | getDbKey () const |
| Get DB key. | |
| QString | getDbKeyAsString () const |
| DB key as string. | |
| QJsonValue | getDbKeyAsJsonValue () const |
| Key as JSON value, or null. | |
| QString | getDbKeyAsStringInParentheses (const QString &prefix={}) const |
| Db key in parentheses, e.g. "(3)". | |
| void | setDbKey (int key) |
| Set the DB key. | |
| void | setDbKey (const QString &key) |
| DB key passed as string. | |
| bool | hasValidDbKey () const |
| Has valid DB key. | |
| bool | isDbEqual (const IDatastoreObjectWithIntegerKey &other) const |
| Same DB key and hence equal. | |
| bool | isLoadedFromDb () const |
| Loaded from DB. | |
| bool | matchesDbKeyState (db::DbKeyStateFilter filter) const |
| Matches filter? | |
| const CIcon & | toDatabaseIcon () const |
| Database icon if this has valid key, otherwise empty. | |
| Public Member Functions inherited from swift::misc::db::IDatastoreObject | |
| const QString & | getVersion () const |
| Version info. | |
| QVersionNumber | getQVersion () const |
| Version as QVersion. | |
| bool | hasVersion () const |
| Having a version?s. | |
| void | setVersion (const QString &version) |
| Version info. | |
| Public Member Functions inherited from swift::misc::ITimestampBased | |
| QDateTime | getUtcTimestamp () const |
| Get timestamp. | |
| qint64 | getMSecsSinceEpoch () const |
| Timestamp as ms value. | |
| qint64 | getTimeDifferenceMs (qint64 compareTime) const |
| Time difference in ms. | |
| qint64 | getTimeDifferenceAbsMs (qint64 compareTime) const |
| Time difference in ms. | |
| qint64 | getTimeDifferenceToNowMs () const |
| Time difference to now. | |
| qint64 | getTimeDifferenceMs (const ITimestampBased &compare) const |
| Time difference in ms. | |
| qint64 | getAbsTimeDifferenceMs (qint64 compareTime) const |
| Time difference in ms. | |
| qint64 | getAbsTimeDifferenceMs (const ITimestampBased &compare) const |
| Time difference in ms. | |
| void | setTimestampToNull () |
| Set to null. | |
| void | setMSecsSinceEpoch (qint64 mSecsSinceEpoch) |
| Timestamp as ms value. | |
| void | setByYearMonthDayHourMinute (const QString &yyyyMMddhhmmss) |
| Set by value such as "20141003231045". | |
| void | setUtcTimestamp (const QDateTime ×tamp) |
| Set timestamp. | |
| bool | isNewerThan (const ITimestampBased &otherTimestampObj) const |
| Is this newer than other? | |
| bool | isNewerThan (qint64 mSecsSinceEpoch) const |
| Is newer than epoch value? | |
| bool | isOlderThan (const ITimestampBased &otherTimestampObj) const |
| Is this older than other? | |
| bool | isOlderThan (qint64 mSecsSinceEpoch) const |
| Is this older than other? | |
| bool | isOlderThanNowMinusOffset (int offsetMs) const |
| Older than now-offset. | |
| bool | isSame (const ITimestampBased &otherTimestampObj) const |
| Same timestamp. | |
| qint64 | msecsTo (const ITimestampBased &otherTimestampObj) const |
| Time difference. | |
| qint64 | absMsecsTo (const ITimestampBased &otherTimestampObj) const |
| Time difference. | |
| qint64 | msecsToNow () const |
| Milliseconds to now. | |
| void | setCurrentUtcTime () |
| Set the current time as timestamp. | |
| void | addMsecs (qint64 ms) |
| Add the given number of milliseconds to the timestamp. | |
| QString | getFormattedUtcTimestampHms () const |
| As hh:mm:ss. | |
| QString | getFormattedUtcTimestampHmsz () const |
| As hh:mm:ss.zzz. | |
| QString | getFormattedUtcTimestampHm () const |
| As hh:mm. | |
| QString | getFormattedUtcTimestampDhms () const |
| As dd HH mm ss. | |
| QString | getFormattedUtcTimestampMdhms () const |
| As MM dd HH mm ss. | |
| QString | getFormattedUtcTimestampMdhmsz () const |
| As MM dd HH mm ss.zzz. | |
| QString | getFormattedUtcTimestampYmdhms () const |
| As yyyy MM dd HH mm ss. | |
| QString | getFormattedUtcTimestampYmdhmsz () const |
| As yyyy MM dd HH mm ss.zzz. | |
| bool | hasValidTimestamp () const |
| Valid timestamp? | |
Static Public Member Functions | |
| static CArtifact | fromDatabaseJson (const QJsonObject &json, const QString &prefix={}) |
| Object from database JSON format. | |
| static const QString & | typeToString (ArtifactType type) |
| Type as string. | |
| static CPlatform | artifactNameToPlatform (const QString &name) |
| Name to platform. | |
| Static Public Member Functions inherited from swift::misc::mixin::MetaType< CArtifact > | |
| static void | registerMetadata () |
| Register metadata. | |
| Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CArtifact > | |
| static DerivedObj | fromJson (const QJsonObject &json) |
| Get object from QJsonObject. | |
| static DerivedObj | fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg) |
| Get object from JSON string. | |
| Static Public Member Functions inherited from swift::misc::db::IDatastoreObjectWithIntegerKey | |
| static int | invalidDbKey () |
| Invalid key. | |
| static int | stringToDbKey (const QString &candidate) |
| Convert string to DB key. | |
| static const CPropertyIndex & | keyIndex () |
| The key index. | |
| Static Public Member Functions inherited from swift::misc::ITimestampBased | |
| static bool | isAnyTimestampIndex (int index) |
| Any of the timestamp indexes. | |
| static bool | canHandleIndex (CPropertyIndexRef index) |
| Can given index be handled. | |
Additional Inherited Members | |
| Protected Member Functions inherited from swift::misc::CValueObject< CArtifact > | |
| CEmpty ()=default | |
| Inheriting constructors. | |
| CEmpty (const CEmpty &)=default | |
| Inheriting constructors. | |
| CValueObject ()=default | |
| Default constructor. | |
| CValueObject & | operator= (const CValueObject &)=default |
| Copy assignment operator. | |
| ~CValueObject ()=default | |
| Destructor. | |
| Protected Member Functions inherited from swift::misc::CEmpty | |
| CEmpty ()=default | |
| Protected default constructor. | |
| CEmpty (const CEmpty &)=default | |
| Protected copy constructor. | |
| CEmpty & | operator= (const CEmpty &)=default |
| Protected copy assignment operator. | |
| ~CEmpty ()=default | |
| Non-virtual protected destructor. | |
| Protected Member Functions inherited from swift::misc::db::IDatastoreObjectWithIntegerKey | |
| IDatastoreObjectWithIntegerKey () | |
| Constructor. | |
| IDatastoreObjectWithIntegerKey (int key) | |
| Constructor. | |
| void | setKeyVersionTimestampFromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
| Set key and timestamp values. | |
| QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const IDatastoreObjectWithIntegerKey &compareValue) const |
| Compare for index. | |
| Protected Member Functions inherited from swift::misc::db::IDatastoreObject | |
| void | setTimestampVersionFromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
| Set versionn and timestamp values. | |
| Protected Member Functions inherited from swift::misc::ITimestampBased | |
| ITimestampBased ()=default | |
| Constructor. | |
| ITimestampBased (qint64 msSincePoch) | |
| Constructor. | |
| ITimestampBased (const QDateTime ×tamp) | |
| Constructor. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const ITimestampBased &compareValue) const |
| Compare for index. | |
| void | updateMissingParts (const ITimestampBased &other) |
| Update missing parts. | |
| Static Protected Member Functions inherited from swift::misc::db::IDatastoreObjectWithIntegerKey | |
| static bool | existsKey (const QJsonObject &json, const QString &prefix=QString()) |
| Is a key available? | |
| static bool | canHandleIndex (swift::misc::CPropertyIndexRef index) |
| Can given index be handled? | |
| Protected Attributes inherited from swift::misc::db::IDatastoreObjectWithIntegerKey | |
| int | m_dbKey = -1 |
| key | |
| Protected Attributes inherited from swift::misc::db::IDatastoreObject | |
| QString | m_version |
| version info | |
| Protected Attributes inherited from swift::misc::ITimestampBased | |
| qint64 | m_timestampMSecsSinceEpoch = -1 |
| timestamp value | |
Artifacts ("our software" products).
Definition at line 22 of file artifact.h.
Type.
Definition at line 40 of file artifact.h.
Properties by index.
Definition at line 26 of file artifact.h.
| swift::misc::db::CArtifact::CArtifact | ( | const QString & | name, |
| const QString & | version, | ||
| const QString & | md5, | ||
| CArtifact::ArtifactType | type, | ||
| int | size, | ||
| bool | existing, | ||
| const CPlatform & | platform ) |
Constructor.
Definition at line 19 of file artifact.cpp.
Name to platform.
Definition at line 208 of file artifact.cpp.
| CRemoteFile swift::misc::db::CArtifact::asRemoteFile | ( | ) | const |
| QString swift::misc::db::CArtifact::convertToQString | ( | bool | i18n = false | ) | const |
Cast as QString.
Definition at line 99 of file artifact.cpp.
| QString swift::misc::db::CArtifact::convertToQString | ( | const QString & | separator, |
| bool | i18n = false ) const |
To string.
Definition at line 101 of file artifact.cpp.
|
static |
Object from database JSON format.
Definition at line 163 of file artifact.cpp.
|
inline |
Related distributions.
Definition at line 98 of file artifact.h.
|
inline |
File size.
Definition at line 77 of file artifact.h.
| QString swift::misc::db::CArtifact::getFileSizeHumanReadable | ( | ) | const |
Human readable (GB, MB, ..) file size.
Definition at line 42 of file artifact.cpp.
|
inline |
MD5.
Definition at line 86 of file artifact.h.
|
inline |
Most stable distribution if any.
Definition at line 101 of file artifact.h.
|
inline |
Name (i.e. installer name, symbol name).
Definition at line 59 of file artifact.h.
|
inline |
OS.
Definition at line 89 of file artifact.h.
|
inline |
Get type.
Definition at line 68 of file artifact.h.
|
inline |
Has distributions?
Definition at line 107 of file artifact.h.
|
inline |
Having name?
Definition at line 56 of file artifact.h.
| bool swift::misc::db::CArtifact::hasUnrestrictedDistribution | ( | ) | const |
Has unrestricted distribution.
Definition at line 53 of file artifact.cpp.
| bool swift::misc::db::CArtifact::isNewerThanCurrentBuild | ( | ) | const |
Newer than the current build.
Definition at line 86 of file artifact.cpp.
|
inline |
Unknown.
Definition at line 71 of file artifact.h.
| bool swift::misc::db::CArtifact::isWithDistribution | ( | const CDistribution & | distribution, |
| bool | acceptMoreStableDistributions ) const |
Is distributed with given distribution?
Definition at line 55 of file artifact.cpp.
| bool swift::misc::db::CArtifact::matchesAnyPlatform | ( | const CPlatform & | platform | ) | const |
Matches any platform.
Definition at line 51 of file artifact.cpp.
| bool swift::misc::db::CArtifact::matchesName | ( | const QString & | name, |
| Qt::CaseSensitivity | cs = Qt::CaseSensitive ) const |
Matching name?
Definition at line 31 of file artifact.cpp.
| QVariant swift::misc::db::CArtifact::propertyByIndex | ( | swift::misc::CPropertyIndexRef | index | ) | const |
Property by index.
Definition at line 109 of file artifact.cpp.
|
inline |
Related distributions.
Definition at line 104 of file artifact.h.
|
inline |
Set file size.
Definition at line 83 of file artifact.h.
|
inline |
Set the name.
Definition at line 62 of file artifact.h.
|
inline |
Set the OS.
Definition at line 95 of file artifact.h.
| void swift::misc::db::CArtifact::setPropertyByIndex | ( | swift::misc::CPropertyIndexRef | index, |
| const QVariant & | variant ) |
Set property by index.
Definition at line 136 of file artifact.cpp.
|
inline |
Set type.
Definition at line 74 of file artifact.h.
|
static |
Type as string.
Definition at line 190 of file artifact.cpp.