C# Class Mosa.FileSystem.FAT.FatFileSystem

Inheritance: GenericFileSystem
Datei anzeigen Open project: tgiphil/MOSA-Project Class Usage Examples

Protected Properties

Property Type Description
lastFreeHint uint

Public Methods

Method Description
AddCluster ( uint lastCluster ) : uint

Adds the cluster.

AllocateFirstCluster ( uint directorySector, uint directorySectorIndex ) : uint

Allocates the first cluster.

CreateFile ( string filename, FatFileAttributes fileAttributes ) : FatFileLocation

Creates the file.

CreateFile ( string filename, FatFileAttributes fileAttributes, uint directoryCluster ) : FatFileLocation

Creates the file.

CreateVFSMount ( ) : IFileSystem

Creates the VFS mount.

Delete ( uint targetCluster, uint directorySector, uint directorySectorIndex ) : void

Deletes the specified file or directory

FatFileSystem ( IPartitionDevice partition ) : Mosa.ClassLib

Initializes a new instance of the FatFileSystem class.

FindEntry ( string name ) : FatFileLocation
FindNthCluster ( uint start, uint count ) : uint

Finds the Nth cluster.

Format ( FatSettings fatSettings ) : bool

Formats the partition with specified fat settings.

GetFileSize ( uint directoryBlock, uint index ) : uint

Gets the size of the file.

GetNextCluster ( uint start ) : uint

Gets the next cluster.

GetSectorByCluster ( uint cluster ) : uint

Gets the sector by cluster.

GetSectorsPerClusterByTotalSectors ( FatType type, uint sectors ) : byte

Gets the sectors per cluster by total sectors.

ReadCluster ( uint cluster, byte block ) : bool

Reads the cluster.

ReadCluster ( uint cluster ) : byte[]

Reads the cluster.

SetVolumeName ( string volumeName ) : void

Sets the name of the volume.

UpdateLength ( uint size, uint firstCluster, uint directorySector, uint directorySectorIndex ) : void

Updates the length.

WriteCluster ( uint cluster, byte block ) : bool

Writes the cluster.

Protected Methods

Method Description
AllocateCluster ( ) : uint

Allocates the cluster.

FreeClusterChain ( uint firstCluster ) : bool

Frees the cluster chain.

GetClusterBySector ( uint sector ) : uint

Gets the cluster by sector.

GetClusterEntryValue ( uint cluster ) : uint

Gets the cluster entry value.

IsClusterBad ( uint cluster ) : bool

Determines whether [is cluster bad] [the specified cluster].

IsClusterFree ( uint cluster ) : bool

Determines whether [is cluster free] [the specified cluster].

IsClusterLast ( uint cluster ) : bool

Determines whether [is cluster last] [the specified cluster].

IsClusterReserved ( uint cluster ) : bool

Determines whether [is cluster reserved] [the specified cluster].

IsValidFatCharacter ( char c ) : bool

Determines whether [is valid fat character] [the specified c].

ReadBootSector ( ) : bool

Reads the boot sector.

SetClusterEntryValue ( uint cluster, uint nextcluster ) : bool

Sets the cluster entry value.

Private Methods

Method Description
ExtractFileName ( byte directory, uint index ) : string

Extracts the name of the file.

FindEntry ( FatFileSystem compare, uint startCluster ) : FatFileLocation

Finds the entry.

GetClusterEntry ( byte data, uint index, FatType type ) : uint

Gets the cluster entry.

Method Details

AddCluster() public method

Adds the cluster.
public AddCluster ( uint lastCluster ) : uint
lastCluster uint The last cluster.
return uint

AllocateCluster() protected method

Allocates the cluster.
protected AllocateCluster ( ) : uint
return uint

AllocateFirstCluster() public method

Allocates the first cluster.
public AllocateFirstCluster ( uint directorySector, uint directorySectorIndex ) : uint
directorySector uint The directory sector.
directorySectorIndex uint Index of the directory sector.
return uint

CreateFile() public method

Creates the file.
public CreateFile ( string filename, FatFileAttributes fileAttributes ) : FatFileLocation
filename string The filename.
fileAttributes FatFileAttributes The file attributes.
return FatFileLocation

CreateFile() public method

Creates the file.
public CreateFile ( string filename, FatFileAttributes fileAttributes, uint directoryCluster ) : FatFileLocation
filename string The filename.
fileAttributes FatFileAttributes The file attributes.
directoryCluster uint The directory cluster.
return FatFileLocation

CreateVFSMount() public method

Creates the VFS mount.
public CreateVFSMount ( ) : IFileSystem
return IFileSystem

Delete() public method

Deletes the specified file or directory
public Delete ( uint targetCluster, uint directorySector, uint directorySectorIndex ) : void
targetCluster uint The target cluster.
directorySector uint The directory sector.
directorySectorIndex uint Index of the directory sector.
return void

FatFileSystem() public method

Initializes a new instance of the FatFileSystem class.
public FatFileSystem ( IPartitionDevice partition ) : Mosa.ClassLib
partition IPartitionDevice The partition.
return Mosa.ClassLib

FindEntry() public method

public FindEntry ( string name ) : FatFileLocation
name string
return FatFileLocation

FindNthCluster() public method

Finds the Nth cluster.
public FindNthCluster ( uint start, uint count ) : uint
start uint The start.
count uint The count.
return uint

Format() public method

Formats the partition with specified fat settings.
public Format ( FatSettings fatSettings ) : bool
fatSettings FatSettings The fat settings.
return bool

FreeClusterChain() protected method

Frees the cluster chain.
protected FreeClusterChain ( uint firstCluster ) : bool
firstCluster uint The first cluster.
return bool

GetClusterBySector() protected method

Gets the cluster by sector.
protected GetClusterBySector ( uint sector ) : uint
sector uint The sector.
return uint

GetClusterEntryValue() protected method

Gets the cluster entry value.
protected GetClusterEntryValue ( uint cluster ) : uint
cluster uint The cluster.
return uint

GetFileSize() public method

Gets the size of the file.
public GetFileSize ( uint directoryBlock, uint index ) : uint
directoryBlock uint The directory block.
index uint The index.
return uint

GetNextCluster() public method

Gets the next cluster.
public GetNextCluster ( uint start ) : uint
start uint The start.
return uint

GetSectorByCluster() public method

Gets the sector by cluster.
public GetSectorByCluster ( uint cluster ) : uint
cluster uint The cluster.
return uint

GetSectorsPerClusterByTotalSectors() public static method

Gets the sectors per cluster by total sectors.
public static GetSectorsPerClusterByTotalSectors ( FatType type, uint sectors ) : byte
type FatType The type.
sectors uint The sectors.
return byte

IsClusterBad() protected method

Determines whether [is cluster bad] [the specified cluster].
protected IsClusterBad ( uint cluster ) : bool
cluster uint The cluster.
return bool

IsClusterFree() protected method

Determines whether [is cluster free] [the specified cluster].
protected IsClusterFree ( uint cluster ) : bool
cluster uint The cluster.
return bool

IsClusterLast() protected method

Determines whether [is cluster last] [the specified cluster].
protected IsClusterLast ( uint cluster ) : bool
cluster uint The cluster.
return bool

IsClusterReserved() protected method

Determines whether [is cluster reserved] [the specified cluster].
protected IsClusterReserved ( uint cluster ) : bool
cluster uint The cluster.
return bool

IsValidFatCharacter() protected static method

Determines whether [is valid fat character] [the specified c].
protected static IsValidFatCharacter ( char c ) : bool
c char The c.
return bool

ReadBootSector() protected method

Reads the boot sector.
protected ReadBootSector ( ) : bool
return bool

ReadCluster() public method

Reads the cluster.
public ReadCluster ( uint cluster, byte block ) : bool
cluster uint The cluster.
block byte The block.
return bool

ReadCluster() public method

Reads the cluster.
public ReadCluster ( uint cluster ) : byte[]
cluster uint The cluster.
return byte[]

SetClusterEntryValue() protected method

Sets the cluster entry value.
protected SetClusterEntryValue ( uint cluster, uint nextcluster ) : bool
cluster uint The cluster.
nextcluster uint The next cluster.
return bool

SetVolumeName() public method

Sets the name of the volume.
public SetVolumeName ( string volumeName ) : void
volumeName string Name of the volume.
return void

UpdateLength() public method

Updates the length.
public UpdateLength ( uint size, uint firstCluster, uint directorySector, uint directorySectorIndex ) : void
size uint The size.
firstCluster uint The first cluster.
directorySector uint The directory sector.
directorySectorIndex uint Index of the directory sector.
return void

WriteCluster() public method

Writes the cluster.
public WriteCluster ( uint cluster, byte block ) : bool
cluster uint The cluster.
block byte The block.
return bool

Property Details

lastFreeHint protected_oe property

protected uint lastFreeHint
return uint