18 : m_timestampMSecsSinceEpoch(timestamp.toMSecsSinceEpoch())
67 if (offsetMs <= 0) {
return false; }
83 qint64 dt = this->
msecsTo(otherTimestampObj);
84 return dt > 0 ? dt : dt * -1;
141 return (index >=
static_cast<int>(IndexUtcTimestamp)) && (index <= static_cast<int>(IndexMSecsSinceEpoch));
146 if (index.
isEmpty()) {
return false; }
184 case IndexUtcTimestampFormattedYmdhms:
185 case IndexUtcTimestampFormattedYmdhmsz:
186 case IndexUtcTimestampFormattedHm:
187 case IndexUtcTimestampFormattedHms:
188 case IndexUtcTimestampFormattedDhms:
214 static const QString ts(
"%1 (%2)");
223 static const QString ts(
"%1/%2 (%3)");
253 if (index.
isEmpty()) {
return false; }
255 return (i >=
static_cast<int>(IndexOffsetMs)) && (i <=
static_cast<int>(IndexOffsetWithUnit));
279 case IndexAdjustedMsWithOffset:
283 case IndexOffsetWithUnit:
312 case IndexAdjustedMsWithOffset:
return;
313 case IndexOffsetWithUnit:
return;
333 case IndexOffsetWithUnit:
338 case IndexAdjustedMsWithOffset:
Non-owning reference to a CPropertyIndex with a subset of its features.
QString toQString(bool i18n=false) const
Cast as QString.
bool isEmpty() const
Empty?
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
qint64 getMSecsSinceEpoch() const
Timestamp as ms value.
bool isNewerThan(const ITimestampBased &otherTimestampObj) const
Is this newer than other?
bool isOlderThanNowMinusOffset(int offsetMs) const
Older than now-offset.
static bool isAnyTimestampIndex(int index)
Any of the timestamp indexes.
void updateMissingParts(const ITimestampBased &other)
Update missing parts.
void setTimestampToNull()
Set to null.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
int comparePropertyByIndex(CPropertyIndexRef index, const ITimestampBased &compareValue) const
Compare for index.
QString getFormattedUtcTimestampYmdhms() const
As yyyy MM dd HH mm ss.
ITimestampBased()=default
Constructor.
void setByYearMonthDayHourMinute(const QString &yyyyMMddhhmmss)
Set by value such as "20141003231045".
static bool canHandleIndex(CPropertyIndexRef index)
Can given index be handled.
QString getFormattedUtcTimestampHmsz() const
As hh:mm:ss.zzz.
qint64 m_timestampMSecsSinceEpoch
timestamp value
void setCurrentUtcTime()
Set the current time as timestamp.
QString getFormattedUtcTimestampHm() const
As hh:mm.
QDateTime getUtcTimestamp() const
Get timestamp.
bool isOlderThan(const ITimestampBased &otherTimestampObj) const
Is this older than other?
QString getFormattedUtcTimestampHms() const
As hh:mm:ss.
ColumnIndex
Properties by index.
qint64 msecsToNow() const
Milliseconds to now.
bool isSame(const ITimestampBased &otherTimestampObj) const
Same timestamp.
QString getFormattedUtcTimestampMdhms() const
As MM dd HH mm ss.
QString getFormattedUtcTimestampDhms() const
As dd HH mm ss.
void setUtcTimestamp(const QDateTime ×tamp)
Set timestamp.
bool hasValidTimestamp() const
Valid timestamp?
qint64 msecsTo(const ITimestampBased &otherTimestampObj) const
Time difference.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
QString getFormattedUtcTimestampYmdhmsz() const
As yyyy MM dd HH mm ss.zzz.
qint64 absMsecsTo(const ITimestampBased &otherTimestampObj) const
Time difference.
QString getFormattedUtcTimestampMdhmsz() const
As MM dd HH mm ss.zzz.
void setMSecsSinceEpoch(qint64 mSecsSinceEpoch)
Timestamp as ms value.
void addMsecs(qint64 ms)
Add the given number of milliseconds to the timestamp.
qint64 getAdjustedMSecsSinceEpoch() const
Timestamp with offset added for interpolation.
static bool canHandleIndex(CPropertyIndexRef index)
Can given index be handled.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
QString getTimeOffsetWithUnit() const
Offset with unit.
qint64 getTimeOffsetMs() const
Milliseconds to add to timestamp for interpolation.
int comparePropertyByIndex(CPropertyIndexRef index, const ITimestampWithOffsetBased &compareValue) const
Compare for index.
qint64 m_timeOffsetMs
offset time in ms
bool hasNonZeroOffsetTime() const
Having a valid offset time.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
bool isNewerThanAdjusted(const ITimestampWithOffsetBased &otherTimestampObj) const
Is this newer than other?
QString getTimestampAndOffset(bool formatted) const
Timestamp and offset.
bool isOlderThanAdjusted(const ITimestampWithOffsetBased &otherTimestampObj) const
Is this older than other?
void addMsecsToOffsetTime(qint64 msToAdd)
Adds a value to offset time.
QString getFormattedTimestampAndOffset(bool includeRawTimestamp) const
Timestamp and offset.
Free functions in swift::misc.
SWIFT_MISC_EXPORT QString removeDateTimeSeparators(const QString &s)
Remove the typical separators such as "-", " ".
SWIFT_MISC_EXPORT QDateTime fromStringUtc(const QString &dateTimeString, const QString &format)
Same as QDateTime::fromString but QDateTime will be set to UTC.
SWIFT_MISC_EXPORT QDateTime parseDateTimeStringOptimized(const QString &dateTimeString)
Parse yyyyMMddHHmmsszzz strings optimized.
qint64 currentMSecsSinceEpoch()
QDateTime fromMSecsSinceEpoch(qint64 msecs)
bool isValid() const const
qint64 toMSecsSinceEpoch() const const
QString toString(QStringView format) const const
QString arg(Args &&... args) const const
QVariant fromValue(T &&value)
QDateTime toDateTime() const const
qlonglong toLongLong(bool *ok) const const
QString toString() const const
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.