kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp
branchRCL_3
changeset 294 039a3e647356
parent 257 3e88ff8f41d5
equal deleted inserted replaced
268:345b1ca54e88 294:039a3e647356
   578             break;
   578             break;
   579     aName[i++] = qu;
   579     aName[i++] = qu;
   580     aName.SetLength(i);
   580     aName.SetLength(i);
   581     }
   581     }
   582 
   582 
   583 TDes& MakePrintable(TDes& aDes)
       
   584 	{
       
   585 	TInt len = aDes.Length();
       
   586 
       
   587 	for (TInt i=0; i<len; i++)
       
   588 		{
       
   589 		if ((TUint8) aDes[i] < 0x20)
       
   590 			aDes[i] = '?';
       
   591 		}
       
   592 	return aDes;
       
   593 	}
       
   594 
       
   595 GLDEF_C TBool DumpDirEntry(TInt aNum, const TUint8* aEntry)
   583 GLDEF_C TBool DumpDirEntry(TInt aNum, const TUint8* aEntry)
   596 //
   584 //
   597 // Dump a single directory entry to the log.  Return false if it was end of
   585 // Dump a single directory entry to the log.  Return false if it was end of
   598 // directory or an invalid entry (and don't display it).
   586 // directory or an invalid entry (and don't display it).
   599 //
   587 //
   613         {
   601         {
   614         TBuf16<15> name;
   602         TBuf16<15> name;
   615         ExtractNameString(name, aEntry);
   603         ExtractNameString(name, aEntry);
   616         TInt ord = aEntry[0];
   604         TInt ord = aEntry[0];
   617         if (ord & KDirLastLongEntry)
   605         if (ord & KDirLastLongEntry)
   618             RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
   606             RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &name, ord & ~KDirLastLongEntry);
   619         else
   607         else
   620             RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
   608             RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &name, ord & ~KDirLastLongEntry);
   621         }
   609         }
   622     else if (!IsValidDirEntry(d))
   610     else if (!IsValidDirEntry(d))
   623         {
   611         {
   624         if (aNum > 0)
   612         if (aNum > 0)
   625             RDebug::Print(_L("%5d: ============= INVALID ENTRY"), aNum);
   613             RDebug::Print(_L("%5d: ============= INVALID ENTRY"), aNum);
   628     else
   616     else
   629         {
   617         {
   630         TBuf<11> name;
   618         TBuf<11> name;
   631         name.Copy(d->Name());
   619         name.Copy(d->Name());
   632         RDebug::Print(_L("%5d: '%S'   %S  start %-5d size %d"),
   620         RDebug::Print(_L("%5d: '%S'   %S  start %-5d size %d"),
   633                       aNum, &MakePrintable(name), DirAttributes(d->Attributes()), d->StartCluster(), d->Size());
   621                       aNum, &name, DirAttributes(d->Attributes()), d->StartCluster(), d->Size());
   634         }
   622         }
   635     return ETrue;
   623     return ETrue;
   636     }
   624     }
   637 
   625 
   638 GLDEF_C void DumpDirCluster(const TUint8* aData, TInt aCluster=0)
   626 GLDEF_C void DumpDirCluster(const TUint8* aData, TInt aCluster=0)