Ignore:
Timestamp:
9/30/2009 2:40:17 AM (5 years ago)
Author:
lowjoel
Message:

-Abstract the FatDirectory? class to a FatDirectoryBase? class which contains interfaces to parse the given FatDirectory? list, but no capability to read/write from disk since the Root directory in FAT12 and FAT16 are different from the Root directory in FAT32.
-Rename ::FatDirectory? to ::FatDirectoryEntry? since that's what it really is.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Util.FileSystem/Fat32Api.cpp

    r1222 r1226  
    2121 
    2222#include <stdafx.h> 
    23 #include <windows.h> 
    24 #include <atlstr.h> 
    25  
    2623#include "FatApi.h" 
    2724 
     
    5047 
    5148        //Seek to the FAT 
    52         VolumeStream->Seek(SectorSizeToSize(BootSector->ReservedSectorCount), SeekOrigin::Begin); 
     49        VolumeStream->Seek(SectorToOffset(BootSector->ReservedSectorCount), SeekOrigin::Begin); 
    5350 
    5451        //Read the FAT 
     
    5855    } 
    5956 
    60     FatDirectory^ Fat32Api::LoadDirectory(unsigned cluster, String^ name, FatDirectory^ parent) 
     57    FatDirectoryBase^ Fat32Api::LoadDirectory(unsigned cluster, String^ name, 
     58        FatDirectoryBase^ parent) 
    6159    { 
    6260        return gcnew Directory(name, parent, cluster, this); 
     
    126124        //Traverse the directories until we get the cluster we want. 
    127125        unsigned cluster = BootSector->Fat32ParameterBlock.RootDirectoryCluster; 
    128         FatDirectory^ parentDir = nullptr; 
     126        FatDirectoryBase^ parentDir = nullptr; 
    129127        for each (String^ component in components) 
    130128        { 
     
    140138    } 
    141139 
    142     Fat32Api::Directory::Directory(String^ name, FatDirectory^ parent, unsigned cluster, Fat32Api^ api) 
     140    Fat32Api::Directory::Directory(String^ name, FatDirectoryBase^ parent, unsigned cluster, Fat32Api^ api) 
    143141        : FatDirectory(name, parent, cluster, api) 
    144142    { 
    145143    } 
    146144 
    147     unsigned Fat32Api::Directory::GetStartCluster(::FatDirectory& directory) 
     145    unsigned Fat32Api::Directory::GetStartCluster(::FatDirectoryEntry& directory) 
    148146    { 
    149147        if (directory.Short.Attributes == 0x0F) 
Note: See TracChangeset for help on using the changeset viewer.