private void ReadDirectory(List <byte[]> sectors, int index, List <CompoundDocumentItem> l) { var br = new BinaryReader(new MemoryStream(sectors[index])); while (br.BaseStream.Position < br.BaseStream.Length) { var e = new CompoundDocumentItem(); e.Read(br); if (e.ObjectType != 0) { l.Add(e); } } }
public CompoundDocumentFile() { RootItem = new CompoundDocumentItem() { Name = "<Root>", Children = new List <CompoundDocumentItem>(), ObjectType = 5 }; minorVersion = 0x3E; majorVersion = 3; sectorShif = 9; minSectorShift = 6; _sectorSize = 1 << sectorShif; _miniSectorSize = 1 << minSectorShift; _sectorSizeInt = _sectorSize / 4; }
private int AddChildren(CompoundDocumentItem item, List <CompoundDocumentItem> l) { var childId = -1; item.ColorFlag = 1; //Always Black-No matter here, we just add nodes as a b-tree if (item.Children.Count > 0) { foreach (var c in item.Children) { InitItem(c); } item.Children.Sort(); childId = SetSiblings(l.Count, item.Children, 0, item.Children.Count - 1, -1); l.AddRange(item.Children); foreach (var c in item.Children) { c.ChildID = AddChildren(c, l); } } return(childId); }
private void InitItem(CompoundDocumentItem item) { item.LeftSibling = -1; item.RightSibling = -1; item._handled = false; }