kerneltest/f32test/filesystem/fat/t_tscan32.cpp
branchRCL_3
changeset 42 a179b74831c9
parent 21 e7d2d738d3c2
child 43 c1f20ce4abcf
equal deleted inserted replaced
41:0ffb4e86fcc9 42:a179b74831c9
   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 
   553 GLDEF_C TBool DumpDirEntry(TInt aNum, const TUint8* aEntry)
   565 GLDEF_C TBool DumpDirEntry(TInt aNum, const TUint8* aEntry)
   554 // 
   566 // 
   555 // Dump a single directory entry to the log.  Return false if it was end of
   567 // Dump a single directory entry to the log.  Return false if it was end of
   556 // directory or an invalid entry (and don't display it).
   568 // directory or an invalid entry (and don't display it).
   557 // 
   569 // 
   567 		{
   579 		{
   568 		TBuf16<15> name;
   580 		TBuf16<15> name;
   569 		ExtractNameString(name, aEntry);
   581 		ExtractNameString(name, aEntry);
   570 		TInt ord = aEntry[0];
   582 		TInt ord = aEntry[0];
   571 		if (ord & KDirLastLongEntry)
   583 		if (ord & KDirLastLongEntry)
   572 			RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &name, ord & ~KDirLastLongEntry);
   584 			RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
   573 		else
   585 		else
   574 			RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &name, ord & ~KDirLastLongEntry);
   586 			RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
   575 		}
   587 		}
   576 	else if (!IsValidDirEntry(d))
   588 	else if (!IsValidDirEntry(d))
   577 		return EFalse;
   589 		return EFalse;
   578 	else
   590 	else
   579 		{
   591 		{
   580 		TBuf<11> name;
   592 		TBuf<11> name;
   581 		name.Copy(d->Name());
   593 		name.Copy(d->Name());
   582 		RDebug::Print(_L("%5d: '%S'  %S  cluster %d"),
   594 		RDebug::Print(_L("%5d: '%S'  %S  cluster %d"),
   583 					  aNum, &name, DirAttributes(d->Attributes()), d->StartCluster());
   595 					  aNum, &MakePrintable(name), DirAttributes(d->Attributes()), d->StartCluster());
   584 		}
   596 		}
   585 	return ETrue;
   597 	return ETrue;
   586 	}
   598 	}
   587 
   599 
   588 GLDEF_C void DumpDirCluster(const TUint8* aData, TInt aCluster=0)
   600 GLDEF_C void DumpDirCluster(const TUint8* aData, TInt aCluster=0)