17 namespace swift::misc::network
26 m_responseTimeMSecsSinceEpoch = QDateTime::currentMSecsSinceEpoch();
34 if (index.
isMyself()) {
return QVariant::fromValue(*
this); }
40 case IndexId:
return QVariant::fromValue(m_id);
41 case IndexSuccess:
return QVariant::fromValue(m_success);
44 case IndexResponseTime:
return QVariant::fromValue(m_responseTimeMs);
53 (*this) = variant.value<
CUrlLog>();
65 case IndexId: m_id = variant.toInt();
break;
66 case IndexSuccess: m_success = variant.toBool();
break;
76 static const QString s(
"Id: %1, success: %2 response: %3ms, started: %4 ended: %5");
79 .arg(m_responseTimeMs)
81 .arg(m_responseTimeMSecsSinceEpoch);
86 static const QByteArray p(QString(
"urlLogId").toLatin1());
90 int CUrlLog::uniqueId()
92 static std::atomic_int s_id { 1 };
93 const int id = s_id++;
Non-owning reference to a CPropertyIndex with a subset of its features.
Q_REQUIRED_RESULT CPropertyIndexRef copyFrontRemoved() const
Copy with first element removed.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
qint64 getMSecsSinceEpoch() const
Timestamp as ms value.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
static bool canHandleIndex(CPropertyIndexRef index)
Can given index be handled.
void setCurrentUtcTime()
Set the current time as timestamp.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
ColumnIndex
Base class enums.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
Information about accessing one URL over the network.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QDateTime getResponseTimestamp() const
Response timestamp.
static const char * propertyNameId()
Property name used for request.
CUrlLog(const CUrl &url={})
Constructor, setting created to now and getting a valid id.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
bool isPending() const
Pending.
void setResponseTimestampToNow()
Set response time and response timestamp.
QString convertToQString(bool i18n=false) const
Cast as QString.
SWIFT_MISC_EXPORT const QString & boolToYesNo(bool v)
Bool to yes/no.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.