diff -r 820b22e13ff1 -r 39c28ec933dd imgtools/imglib/filesystem/include/fat32filesystem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imgtools/imglib/filesystem/include/fat32filesystem.h Mon May 10 19:54:49 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* FAT32 file system Class for FileSystem component +* @internalComponent +* @released +* +*/ + + +#ifndef FAT32FILESYSTEM_H +#define FAT32FILESYSTEM_H + +#include "filesystemclass.h" +#include "errorhandler.h" +#include "dirregion.h" +#include "filesysteminterface.h" + +// constant values to initialize FSInfo data structure +const unsigned int KFSIleadSign=0x41615252; +const unsigned int KFSIStrutSign=0x61417272; +const unsigned int KFSIFreeCount=0xFFFFFFFF; +const unsigned int KFSITrailSign=0xAA550000; + +//sector number containing copy of FAT Table and Boot sector +const unsigned int KBootBackupSector=6; +const unsigned int KFatBackupSector=7; + +/** +Class representing FSINFO DataStrcuture + +@internalComponent +@released +*/ +class FSInfo +{ + +public: + void SetFSInfo(); +public: + //lead signature use to validate a FSInfo structure + unsigned int FSI_LeadSign; + //field for future expansion + unsigned char FSI_Reserved[KFSIFutureExpansion]; + //another signature + unsigned int FSI_StrucSig; + //contains the last known free cluster count on the volume + unsigned int FSI_Free_Count; + //indicates the cluster number at which the driver should start looking for free clusters + unsigned int FSI_Nxt_Free; + //reserved for future expansion + unsigned int FSI_Reserved2[KFSIKFSIFutureExpansion2]; + //use to validate that this is an fact an FSInfo sector + unsigned int FSI_TrailSig; + +}; + +// Use to initialize the FSInfo data structure +inline void FSInfo::SetFSInfo() +{ + FSI_LeadSign=KFSIleadSign; + for(int i=0;i