imgtools/imglib/filesystem/include/filesysteminterface.h
changeset 0 044383f39525
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * Interface class for FileSystem component
       
    16 * @internalComponent
       
    17 * @released
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef FILESYSTEMINTERFACE_H
       
    23 #define FILESYSTEMINTERFACE_H
       
    24 
       
    25 #include "directory.h"
       
    26 #include <fstream>
       
    27 
       
    28 typedef std::ofstream Ofstream;
       
    29 
       
    30 //default image size in Bytes
       
    31 const int KDefaultImageSize=50*1024*1024;
       
    32 
       
    33 //enum representing the file system type
       
    34 enum FILESYSTEM_API TFileSystem
       
    35 {
       
    36 	EFATINVALID=0,
       
    37 	EFAT12=1,
       
    38 	EFAT16,
       
    39 	EFAT32,
       
    40 	ELFFS
       
    41 };
       
    42 
       
    43 //error code return by the file system component
       
    44 enum TErrorCodes
       
    45 {
       
    46 	//File system not supported
       
    47 	EFSNotSupported = -1,
       
    48 	//File System general errors
       
    49 	EFileSystemError = EXIT_FAILURE
       
    50 };
       
    51 
       
    52 // Configurable FAT attributes
       
    53 struct ConfigurableFatAttributes
       
    54 {
       
    55 	String iDriveVolumeLabel;
       
    56 	unsigned int iDriveSectorSize;
       
    57 	unsigned int iDriveNoOfFATs;
       
    58 	
       
    59 	ConfigurableFatAttributes();
       
    60 };
       
    61 
       
    62 /**
       
    63 Interface class containing a static method exposed by the FileSystem 
       
    64 component to be used by an external tools
       
    65 
       
    66 @internalComponent
       
    67 @released
       
    68 
       
    69 @param aNodeList Directory structure 
       
    70 @param aFileSystem file system type
       
    71 @param aImageFileName image file name 
       
    72 @param aLogFileName log file name 
       
    73 @param aPartitionSize partition size in bytes
       
    74 */
       
    75 
       
    76 class CFileSystemInterFace
       
    77 {
       
    78 private:
       
    79 		static Ofstream iOutputStream;
       
    80 public:
       
    81 		/**This method is exported to the external component to receive the information 
       
    82 		 * required by the FileSystem component
       
    83 		 */
       
    84 		static FILESYSTEM_API int CreateFilesystem(	EntryList* aNodeList ,TFileSystem aFileSystem, 
       
    85 													char* aImageFileName, 
       
    86 													char* aLogFileName,
       
    87 													ConfigurableFatAttributes* aConfigurableFatAttributes,
       
    88 													Long64 aPartitionSize=KDefaultImageSize); 
       
    89 };
       
    90 
       
    91 #endif //FILESYSTEMINTERFACE_H