kerneltest/f32test/filesystem/fat/t_tscan32.cpp
branchRCL_3
changeset 294 039a3e647356
parent 257 3e88ff8f41d5
equal deleted inserted replaced
268:345b1ca54e88 294:039a3e647356
   548 			break;
   548 			break;
   549 	aName[i++] = qu;
   549 	aName[i++] = qu;
   550 	aName.SetLength(i);
   550 	aName.SetLength(i);
   551 	}
   551 	}
   552 
   552 
   553 TDes& MakePrintable(TDes& aDes)
       
   554 	{
       
   555 	TInt len = aDes.Length();
       
   556 
       
   557 	for (TInt i=0; i<len; i++)
       
   558 		{
       
   559 		if ((TUint8) aDes[i] < 0x20)
       
   560 			aDes[i] = '?';
       
   561 		}
       
   562 	return aDes;
       
   563 	}
       
   564 
       
   565 GLDEF_C TBool DumpDirEntry(TInt aNum, const TUint8* aEntry)
   553 GLDEF_C TBool DumpDirEntry(TInt aNum, const TUint8* aEntry)
   566 // 
   554 // 
   567 // Dump a single directory entry to the log.  Return false if it was end of
   555 // Dump a single directory entry to the log.  Return false if it was end of
   568 // directory or an invalid entry (and don't display it).
   556 // directory or an invalid entry (and don't display it).
   569 // 
   557 // 
   579 		{
   567 		{
   580 		TBuf16<15> name;
   568 		TBuf16<15> name;
   581 		ExtractNameString(name, aEntry);
   569 		ExtractNameString(name, aEntry);
   582 		TInt ord = aEntry[0];
   570 		TInt ord = aEntry[0];
   583 		if (ord & KDirLastLongEntry)
   571 		if (ord & KDirLastLongEntry)
   584 			RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
   572 			RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &name, ord & ~KDirLastLongEntry);
   585 		else
   573 		else
   586 			RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
   574 			RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &name, ord & ~KDirLastLongEntry);
   587 		}
   575 		}
   588 	else if (!IsValidDirEntry(d))
   576 	else if (!IsValidDirEntry(d))
   589 		return EFalse;
   577 		return EFalse;
   590 	else
   578 	else
   591 		{
   579 		{
   592 		TBuf<11> name;
   580 		TBuf<11> name;
   593 		name.Copy(d->Name());
   581 		name.Copy(d->Name());
   594 		RDebug::Print(_L("%5d: '%S'  %S  cluster %d"),
   582 		RDebug::Print(_L("%5d: '%S'  %S  cluster %d"),
   595 					  aNum, &MakePrintable(name), DirAttributes(d->Attributes()), d->StartCluster());
   583 					  aNum, &name, DirAttributes(d->Attributes()), d->StartCluster());
   596 		}
   584 		}
   597 	return ETrue;
   585 	return ETrue;
   598 	}
   586 	}
   599 
   587 
   600 GLDEF_C void DumpDirCluster(const TUint8* aData, TInt aCluster=0)
   588 GLDEF_C void DumpDirCluster(const TUint8* aData, TInt aCluster=0)