sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // f32\sfat\inc\sl_bpb.inl sl@0: // sl@0: // sl@0: sl@0: //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! sl@0: //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! sl@0: //!! sl@0: //!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it sl@0: //!! sl@0: //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! sl@0: //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! sl@0: sl@0: #ifndef SL_BPB_INL sl@0: #define SL_BPB_INL sl@0: sl@0: sl@0: #define pDir ((SFatDirEntry*)&iData[0]) sl@0: sl@0: // class TFatBootSector sl@0: inline const TPtrC8 TFatBootSector::VendorId() const sl@0: {return TPtrC8(iVendorId,8);} sl@0: inline TInt TFatBootSector::BytesPerSector() const sl@0: {return iBytesPerSector;} sl@0: inline TInt TFatBootSector::SectorsPerCluster() const sl@0: {return iSectorsPerCluster;} sl@0: inline TInt TFatBootSector::ReservedSectors() const sl@0: {return iReservedSectors;} sl@0: inline TInt TFatBootSector::NumberOfFats() const sl@0: {return iNumberOfFats;} sl@0: inline TInt TFatBootSector::RootDirEntries() const sl@0: {return iRootDirEntries;} sl@0: inline TInt TFatBootSector::TotalSectors() const sl@0: {return iTotalSectors;} sl@0: inline TUint8 TFatBootSector::MediaDescriptor() const sl@0: {return iMediaDescriptor;} sl@0: inline TInt TFatBootSector::FatSectors() const sl@0: {return iFatSectors;} sl@0: inline TInt TFatBootSector::SectorsPerTrack() const sl@0: {return iSectorsPerTrack;} sl@0: inline TInt TFatBootSector::NumberOfHeads() const sl@0: {return iNumberOfHeads;} sl@0: inline TInt TFatBootSector::HiddenSectors() const sl@0: {return iHiddenSectors;} sl@0: inline TInt TFatBootSector::HugeSectors() const sl@0: {return iHugeSectors;} sl@0: inline TInt TFatBootSector::PhysicalDriveNumber() const sl@0: {return iPhysicalDriveNumber;} sl@0: inline TInt TFatBootSector::ExtendedBootSignature() const sl@0: {return iExtendedBootSignature;} sl@0: inline TUint32 TFatBootSector::UniqueID() const sl@0: {return iUniqueID;} sl@0: inline const TPtrC8 TFatBootSector::VolumeLabel() const sl@0: {return TPtrC8(iVolumeLabel,KVolumeLabelSize);} sl@0: inline const TPtrC8 TFatBootSector::FileSysType() const sl@0: {return TPtrC8(iFileSysType,KFileSysTypeSize);} sl@0: inline TInt TFatBootSector::BootSectorSignature() const sl@0: {return KBootSectorSignature;} sl@0: sl@0: inline void TFatBootSector::SetJumpInstruction() sl@0: { sl@0: iJumpInstruction[0]=0xE9;iJumpInstruction[2]=0x90; sl@0: } sl@0: inline void TFatBootSector::SetVendorID(const TDesC8& aDes) sl@0: { sl@0: __ASSERT_DEBUG(aDes.Length()<=8,Fault(EFatBadBootSectorParameter)); sl@0: TPtr8 buf(iVendorId,8); sl@0: buf=aDes; sl@0: } sl@0: inline void TFatBootSector::SetBytesPerSector(TInt aBytesPerSector) sl@0: { sl@0: __ASSERT_DEBUG(!(aBytesPerSector&~KMaxTUint16),Fault(EFatBadBootSectorParameter)); sl@0: iBytesPerSector=(TUint16)aBytesPerSector; sl@0: } sl@0: inline void TFatBootSector::SetSectorsPerCluster(TInt aSectorsPerCluster) sl@0: { sl@0: __ASSERT_DEBUG(!(aSectorsPerCluster&~KMaxTUint8),Fault(EFatBadBootSectorParameter)); sl@0: iSectorsPerCluster=(TUint8)aSectorsPerCluster; sl@0: } sl@0: inline void TFatBootSector::SetReservedSectors(TInt aReservedSectors) sl@0: { sl@0: __ASSERT_DEBUG(!(aReservedSectors&~KMaxTUint16),Fault(EFatBadBootSectorParameter)); sl@0: iReservedSectors=(TUint16)aReservedSectors; sl@0: } sl@0: inline void TFatBootSector::SetNumberOfFats(TInt aNumberOfFats) sl@0: { sl@0: __ASSERT_DEBUG(!(aNumberOfFats&~KMaxTUint8),Fault(EFatBadBootSectorParameter)); sl@0: iNumberOfFats=(TUint8)aNumberOfFats; sl@0: } sl@0: inline void TFatBootSector::SetRootDirEntries(TInt aRootDirEntries) sl@0: { sl@0: __ASSERT_DEBUG(!(aRootDirEntries&~KMaxTUint16),Fault(EFatBadBootSectorParameter)); sl@0: iRootDirEntries=(TUint16)aRootDirEntries; sl@0: } sl@0: inline void TFatBootSector::SetTotalSectors(TInt aTotalSectors) sl@0: { sl@0: __ASSERT_DEBUG(!(aTotalSectors&~KMaxTUint16),Fault(EFatBadBootSectorParameter)); sl@0: iTotalSectors=(TUint16)aTotalSectors; sl@0: } sl@0: inline void TFatBootSector::SetMediaDescriptor(TUint8 aMediaDescriptor) sl@0: {iMediaDescriptor=aMediaDescriptor;} sl@0: inline void TFatBootSector::SetFatSectors(TInt aFatSectors) sl@0: { sl@0: __ASSERT_DEBUG(!(aFatSectors&~KMaxTUint16),Fault(EFatBadBootSectorParameter)); sl@0: iFatSectors=(TUint16)aFatSectors; sl@0: } sl@0: inline void TFatBootSector::SetSectorsPerTrack(TInt aSectorsPerTrack) sl@0: { sl@0: __ASSERT_DEBUG(!(aSectorsPerTrack&~KMaxTUint16),Fault(EFatBadBootSectorParameter)); sl@0: iSectorsPerTrack=(TUint16)aSectorsPerTrack; sl@0: } sl@0: inline void TFatBootSector::SetNumberOfHeads(TInt aNumberOfHeads) sl@0: { sl@0: __ASSERT_DEBUG(!(aNumberOfHeads&~KMaxTUint16),Fault(EFatBadBootSectorParameter)); sl@0: iNumberOfHeads=(TUint16)aNumberOfHeads; sl@0: } sl@0: inline void TFatBootSector::SetHiddenSectors(TUint32 aHiddenSectors) sl@0: { sl@0: iHiddenSectors=(TUint32)(aHiddenSectors); sl@0: } sl@0: inline void TFatBootSector::SetHugeSectors(TUint32 aHugeSectors) sl@0: {iHugeSectors=aHugeSectors;} sl@0: inline void TFatBootSector::SetPhysicalDriveNumber(TInt aPhysicalDriveNumber) sl@0: { sl@0: __ASSERT_DEBUG(!(aPhysicalDriveNumber&~KMaxTUint8),Fault(EFatBadBootSectorParameter)); sl@0: iPhysicalDriveNumber=(TUint8)aPhysicalDriveNumber; sl@0: } sl@0: inline void TFatBootSector::SetReservedByte(TUint8 aReservedByte) sl@0: {iReserved=aReservedByte;} sl@0: inline void TFatBootSector::SetExtendedBootSignature(TInt anExtendedBootSignature) sl@0: { sl@0: __ASSERT_DEBUG(!(anExtendedBootSignature&~KMaxTUint8),Fault(EFatBadBootSectorParameter)); sl@0: iExtendedBootSignature=(TUint8)anExtendedBootSignature; sl@0: } sl@0: inline void TFatBootSector::SetUniqueID(TUint32 anUniqueID) sl@0: {iUniqueID=anUniqueID;} sl@0: inline void TFatBootSector::SetVolumeLabel(const TDesC8& aDes) sl@0: { sl@0: __ASSERT_DEBUG(aDes.Length()<=KVolumeLabelSize,Fault(EFatBadBootSectorParameter)); sl@0: TPtr8 buf(iVolumeLabel,KVolumeLabelSize); sl@0: buf=aDes; sl@0: } sl@0: inline void TFatBootSector::SetFileSysType(const TDesC8& aDes) sl@0: { sl@0: __ASSERT_DEBUG(aDes.Length()<=8,Fault(EFatBadBootSectorParameter)); sl@0: TPtr8 buf(iFileSysType,8); sl@0: buf=aDes; sl@0: } sl@0: sl@0: sl@0: #endif //SL_BPB_INL