本文整理汇总了C++中QFileSystemMetaData::fillFromTEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileSystemMetaData::fillFromTEntry方法的具体用法?C++ QFileSystemMetaData::fillFromTEntry怎么用?C++ QFileSystemMetaData::fillFromTEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFileSystemMetaData
的用法示例。
在下文中一共展示了QFileSystemMetaData::fillFromTEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: advance
bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaData &metaData)
{
//1st time, lastError is result of dirHandle.Open(), entries.Count() is 0 and entryIndex is -1 so initial read is triggered
//subsequent times, read is triggered each time we reach the end of the entry list
//final time, lastError is KErrEof so we don't need to read anymore.
++entryIndex;
if (lastError == KErrNone && entryIndex >= entries.Count()) {
lastError = dirHandle.Read(entries);
entryIndex = 0;
}
//each call to advance() gets the next entry from the entry list.
//from the final (or only) read call, KErrEof is returned together with a full buffer so we still need to go through the list
if ((lastError == KErrNone || lastError == KErrEof) && entryIndex < entries.Count()) {
Q_ASSERT(entryIndex >= 0);
const TEntry &entry(entries[entryIndex]);
fileEntry = QFileSystemEntry(nativePath + qt_TDesC2QString(entry.iName), QFileSystemEntry::FromNativePath());
metaData.fillFromTEntry(entry);
return true;
}
//TODO: error reporting, to allow user to distinguish empty directory from error condition.
return false;
}
示例2: fillMetaData
//static
bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
{
if (what & QFileSystemMetaData::SymbianTEntryFlags) {
RFs& fs(qt_s60GetRFs());
TInt err;
QFileSystemEntry absentry(absoluteName(entry));
if (entry.isEmpty()) {
err = KErrNotFound;
} else if (absentry.isRoot()) {
//Root directories don't have an entry, and Entry() returns KErrBadName.
//Therefore get information about the volume instead.
TInt drive;
err = RFs::CharToDrive(TChar(absentry.nativeFilePath().at(0).unicode()), drive);
if (!err) {
TVolumeInfo info;
err = fs.Volume(info, drive);
if (!err)
data.fillFromVolumeInfo(info);
}
} else {
TEntry ent;
err = fs.Entry(qt_QString2TPtrC(absentry.nativeFilePath()), ent);
if (!err)
data.fillFromTEntry(ent);
}
if (err) {
data.size_ = 0;
data.modificationTime_ = TTime(0);
data.entryFlags &= ~(QFileSystemMetaData::SymbianTEntryFlags);
}
//files in /sys/bin on any drive are executable, even though we don't normally have permission to check whether they exist or not
if(absentry.filePath().midRef(1,10).compare(QLatin1String(":/sys/bin/"), Qt::CaseInsensitive) == 0)
data.entryFlags |= QFileSystemMetaData::ExecutePermissions;
}
return data.hasFlags(what);
}