public void SearchByTree(FileSystem.NodeVisitCallback callback, string searchPath) { FileSystemNode searchRoot = this._root; if (!string.IsNullOrEmpty(searchPath)) { searchRoot = this.GetFirstFile(searchPath) ?? searchRoot; } Visit(callback, searchRoot); }
private void Visit(FileSystem.NodeVisitCallback callback, FileSystemNode node) { if (!callback(node, 0, 1)) { return; } if (node is Folder && !(node is HiddenDataStreamFileNTFS)) //No zip support yet { foreach (FileSystemNode child in node.GetChildren()) { Visit(callback, child); } } }
private void SectorSearch(FileSystem.NodeVisitCallback callback) { long clusterNum = BPB_RootClus; ulong progress = 0; ulong total = (ulong)(TotalSectors * SectorsPerCluster - (_rootDirLocation + BPB_RootClus * BytesPerCluster)); while (_rootDirLocation + clusterNum * BytesPerCluster < TotalSectors * SectorsPerCluster) { progress++; clusterNum++; if (!callback(new FileFAT(this, clusterNum), progress, total)) { break; } } }
private void MftScan(FileSystem.NodeVisitCallback callback) { ulong numFiles = _MFT.StreamLength / (ulong)(SectorsPerMFTRecord * BytesPerSector); for (ulong i = 0; i < numFiles; i++) { MFTRecord record = MFTRecord.Load(i, this, MFTLoadDepth.NameAttributeOnly); if (record.Valid) { if (!callback(record, i, numFiles)) { return; } } } }
public void SearchByMFT(FileSystem.NodeVisitCallback callback, string searchPath) { MftScan(callback); }
public void SearchByCluster(FileSystem.NodeVisitCallback callback, string searchPath) { SectorSearch(callback); }
public void Search(FileSystem.NodeVisitCallback callback) { _func(callback, null); }
public void Search(FileSystem.NodeVisitCallback callback, string searchPath) { _func(callback, searchPath); }