本文整理汇总了C++中TimeInfo::lastModificationTime方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeInfo::lastModificationTime方法的具体用法?C++ TimeInfo::lastModificationTime怎么用?C++ TimeInfo::lastModificationTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeInfo
的用法示例。
在下文中一共展示了TimeInfo::lastModificationTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QVERIFY
void TestKeePass2Format::testXmlGroupRoot()
{
const Group* group = m_xmlDb->rootGroup();
QVERIFY(group);
QCOMPARE(group->uuid(), QUuid::fromRfc4122(QByteArray::fromBase64("lmU+9n0aeESKZvcEze+bRg==")));
QCOMPARE(group->name(), QString("NewDatabase"));
QCOMPARE(group->notes(), QString(""));
QCOMPARE(group->iconNumber(), 49);
QCOMPARE(group->iconUuid(), QUuid());
QVERIFY(group->isExpanded());
TimeInfo ti = group->timeInfo();
QCOMPARE(ti.lastModificationTime(), MockClock::datetimeUtc(2010, 8, 8, 17, 24, 27));
QCOMPARE(ti.creationTime(), MockClock::datetimeUtc(2010, 8, 7, 17, 24, 27));
QCOMPARE(ti.lastAccessTime(), MockClock::datetimeUtc(2010, 8, 9, 9, 9, 44));
QCOMPARE(ti.expiryTime(), MockClock::datetimeUtc(2010, 8, 8, 17, 24, 17));
QVERIFY(!ti.expires());
QCOMPARE(ti.usageCount(), 52);
QCOMPARE(ti.locationChanged(), MockClock::datetimeUtc(2010, 8, 8, 17, 24, 27));
QCOMPARE(group->defaultAutoTypeSequence(), QString(""));
QCOMPARE(group->autoTypeEnabled(), Group::Inherit);
QCOMPARE(group->searchingEnabled(), Group::Inherit);
QCOMPARE(group->lastTopVisibleEntry()->uuid(),
QUuid::fromRfc4122(QByteArray::fromBase64("+wSUOv6qf0OzW8/ZHAs2sA==")));
QCOMPARE(group->children().size(), 3);
QVERIFY(m_xmlDb->metadata()->recycleBin() == m_xmlDb->rootGroup()->children().at(2));
QCOMPARE(group->entries().size(), 2);
}
示例2: writeTimes
void KdbxXmlWriter::writeTimes(const TimeInfo& ti)
{
m_xml.writeStartElement("Times");
writeDateTime("LastModificationTime", ti.lastModificationTime());
writeDateTime("CreationTime", ti.creationTime());
writeDateTime("LastAccessTime", ti.lastAccessTime());
writeDateTime("ExpiryTime", ti.expiryTime());
writeBool("Expires", ti.expires());
writeNumber("UsageCount", ti.usageCount());
writeDateTime("LocationChanged", ti.locationChanged());
m_xml.writeEndElement();
}
示例3: QCOMPARE
void TestKeePass2Format::testXmlEntry1()
{
const Entry* entry = m_xmlDb->rootGroup()->entries().at(0);
QCOMPARE(entry->uuid(), QUuid::fromRfc4122(QByteArray::fromBase64("+wSUOv6qf0OzW8/ZHAs2sA==")));
QCOMPARE(entry->historyItems().size(), 2);
QCOMPARE(entry->iconNumber(), 0);
QCOMPARE(entry->iconUuid(), QUuid());
QVERIFY(!entry->foregroundColor().isValid());
QVERIFY(!entry->backgroundColor().isValid());
QCOMPARE(entry->overrideUrl(), QString(""));
QCOMPARE(entry->tags(), QString("a b c"));
const TimeInfo ti = entry->timeInfo();
QCOMPARE(ti.lastModificationTime(), MockClock::datetimeUtc(2010, 8, 25, 16, 19, 25));
QCOMPARE(ti.creationTime(), MockClock::datetimeUtc(2010, 8, 25, 16, 13, 54));
QCOMPARE(ti.lastAccessTime(), MockClock::datetimeUtc(2010, 8, 25, 16, 19, 25));
QCOMPARE(ti.expiryTime(), MockClock::datetimeUtc(2010, 8, 25, 16, 12, 57));
QVERIFY(!ti.expires());
QCOMPARE(ti.usageCount(), 8);
QCOMPARE(ti.locationChanged(), MockClock::datetimeUtc(2010, 8, 25, 16, 13, 54));
QList<QString> attrs = entry->attributes()->keys();
QCOMPARE(entry->attributes()->value("Notes"), QString("Notes"));
QVERIFY(!entry->attributes()->isProtected("Notes"));
QVERIFY(attrs.removeOne("Notes"));
QCOMPARE(entry->attributes()->value("Password"), QString("Password"));
QVERIFY(!entry->attributes()->isProtected("Password"));
QVERIFY(attrs.removeOne("Password"));
QCOMPARE(entry->attributes()->value("Title"), QString("Sample Entry 1"));
QVERIFY(!entry->attributes()->isProtected("Title"));
QVERIFY(attrs.removeOne("Title"));
QCOMPARE(entry->attributes()->value("URL"), QString(""));
QVERIFY(entry->attributes()->isProtected("URL"));
QVERIFY(attrs.removeOne("URL"));
QCOMPARE(entry->attributes()->value("UserName"), QString("User Name"));
QVERIFY(entry->attributes()->isProtected("UserName"));
QVERIFY(attrs.removeOne("UserName"));
QVERIFY(attrs.isEmpty());
QCOMPARE(entry->title(), entry->attributes()->value("Title"));
QCOMPARE(entry->url(), entry->attributes()->value("URL"));
QCOMPARE(entry->username(), entry->attributes()->value("UserName"));
QCOMPARE(entry->password(), entry->attributes()->value("Password"));
QCOMPARE(entry->notes(), entry->attributes()->value("Notes"));
QCOMPARE(entry->attachments()->keys().size(), 1);
QCOMPARE(entry->attachments()->value("myattach.txt"), QByteArray("abcdefghijk"));
QCOMPARE(entry->historyItems().at(0)->attachments()->keys().size(), 1);
QCOMPARE(entry->historyItems().at(0)->attachments()->value("myattach.txt"), QByteArray("0123456789"));
QCOMPARE(entry->historyItems().at(1)->attachments()->keys().size(), 1);
QCOMPARE(entry->historyItems().at(1)->attachments()->value("myattach.txt"), QByteArray("abcdefghijk"));
QCOMPARE(entry->autoTypeEnabled(), false);
QCOMPARE(entry->autoTypeObfuscation(), 0);
QCOMPARE(entry->defaultAutoTypeSequence(), QString(""));
QCOMPARE(entry->autoTypeAssociations()->size(), 1);
const AutoTypeAssociations::Association assoc1 = entry->autoTypeAssociations()->get(0);
QCOMPARE(assoc1.window, QString("Target Window"));
QCOMPARE(assoc1.sequence, QString(""));
}