本文整理汇总了C++中TEntry::MostDerivedUid方法的典型用法代码示例。如果您正苦于以下问题:C++ TEntry::MostDerivedUid方法的具体用法?C++ TEntry::MostDerivedUid怎么用?C++ TEntry::MostDerivedUid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEntry
的用法示例。
在下文中一共展示了TEntry::MostDerivedUid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestL
static void TestL()
{
CHlpFileList* masterList = new(ELeave) CHlpFileList(5);
CleanupStack::PushL(masterList);
TInt i = EDriveY;
FOREVER
{
// Make sure we go from Y -> C, then do Z last
if (i < EDriveC)
i = EDriveZ;
if (DiskPresent(i))
{
{
TChar driveLetter = '?';
RFs::DriveToChar(i, driveLetter);
TheTest.Printf(_L("\n\nDisk %c: is installed..."), static_cast<TUint>(driveLetter));
}
// This generates a list for a specific directory on the specified drive.
CHlpFileList* list = BuildListForDriveLC(TDriveUnit(i), TheFs);
// We now compare this list with our 'master' list to check for duplicates,
// better matches, etc.
TInt masterCount = masterList->Count();
for(TInt j=masterCount-1; j>=0; j--)
{
CHlpFileEntry* entry = masterList->At(j);
// This bit checks to see if an entry in the master list
// collides with an entry in the list we have just generated...
//TBool foundCollision = EFalse;
TInt newListCount = list->Count();
for(TInt k=newListCount-1; k>=0; k--)
{
CHlpFileEntry* newEntry = list->At(k);
__PRINT_FILE_NO(_L("Performing drive resolution on entry"), *newEntry, k);
if (entry->Name().CompareF(newEntry->Name()) == 0)
{
// Names are the same, so compare priorities...
if (newEntry->Type() == entry->Type())
{
// A file with the same name AND extension is already present in the array,
// but are the UID's the same? If they are NOT, then the file
// should be treated as a different help file to that of the
// existing array entry.
TFileName file;
TEntry existingTEntry;
entry->GetFullNameAndPath(file);
User::LeaveIfError(TheFs.Entry(file, existingTEntry));
TEntry newTEntry;
newEntry->GetFullNameAndPath(file);
User::LeaveIfError(TheFs.Entry(file, newTEntry));
if (existingTEntry.MostDerivedUid() == newTEntry.MostDerivedUid())
{
// The uids and names of the files are the same. If the extensions are also the same
// then we load the file on the drive tending to C:. However, if the extensions differ
// we load the file with the extension tending to 01, i.e. UK English.
if (entry->FileName().CompareF(newEntry->FileName()) == 0)
{
// Name, uid and extensions are the same, therefore load the file on the drive
// nearest C:. We do this by setting the priority of the existing entry to
// EDsicarded so that it will force the next 'if' statement to fire, and hence
// the existing entry will be replaced by the new one.
entry->SetType(CHlpFileEntry::EDiscarded);
__PRINT_FILE(_L("Uid, name, extension match. Saving entry tending to C: which is"), *newEntry);
}
else
{
// Name and uid the same, extensions different therefore load the file with
// extension nearest to 01. If the new entry is nearer 01, then we set the
// existing entry to discarded and therefore it will be removed at the next
// 'if' statement.
if (entry->HelpFileLocale() > newEntry->HelpFileLocale())
{
entry->SetType(CHlpFileEntry::EDiscarded);
__PRINT_FILE(_L("Uid & name match, extensions differ.\n Saving entry tending to H01 which is"), *newEntry);
}
else
{
__PRINT_FILE(_L("Uid & name match, extensions differ.\n Discarding new entry because it tends to H99"), *newEntry);
}
}
}
else
{
// This entry should be treated as a separate entity from the current
// existing entry because it has different uid's. Therefore, we just
// move on to check against the next existing entry in the list
__PRINT_FILE(_L("Duplicate name and extension, but different uids detected. New entry == "), *newEntry);
continue;
}
}
//.........这里部分代码省略.........