public static void GenerateDirectoryTable(List <DirectoryTableEntry> directoryTable, SFSDirectory dir)
        {
            DirectoryTableEntry cur = new DirectoryTableEntry();

            if (dir.IsRoot)
            {
                cur.dirParentID   = (ushort)(dir.TotalNrSubDirectories + 1);
                cur.dirEntryStart = cur.dirParentID * 8u;
            }
            else
            {
                cur.dirParentID = dir.Parent.DirectoryID;
            }
            dir.DirectoryID = (ushort)(0xF000 + directoryTable.Count);
            directoryTable.Add(cur);
            foreach (SFSDirectory d in dir.SubDirectories)
            {
                GenerateDirectoryTable(directoryTable, d);
            }
        }
Esempio n. 2
0
 public static void GenerateDirectoryTable(List<DirectoryTableEntry> directoryTable, SFSDirectory dir)
 {
     DirectoryTableEntry cur = new DirectoryTableEntry();
     if (dir.IsRoot)
     {
         cur.dirParentID = (ushort)(dir.TotalNrSubDirectories + 1);
         cur.dirEntryStart = cur.dirParentID * 8u;
     }
     else cur.dirParentID = dir.Parent.DirectoryID;
     dir.DirectoryID = (ushort)(0xF000 + directoryTable.Count);
     directoryTable.Add(cur);
     foreach (SFSDirectory d in dir.SubDirectories)
     {
         GenerateDirectoryTable(directoryTable, d);
     }
 }