IndexNode.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Text;
  10. using Utilities;
  11. namespace DiskAccessLibrary.FileSystems.NTFS
  12. {
  13. public class IndexNode // intermediate node
  14. {
  15. public List<IndexNodeEntry> Entries = new List<IndexNodeEntry>();
  16. public IndexNode(byte[] buffer, int offset)
  17. {
  18. int position = offset;
  19. while (true)
  20. {
  21. IndexNodeEntry node = new IndexNodeEntry(buffer, ref position);
  22. if (node.IsLastEntry && !node.PointsToSubnode)
  23. {
  24. break;
  25. }
  26. Entries.Add(node);
  27. if (node.IsLastEntry)
  28. {
  29. break;
  30. }
  31. }
  32. }
  33. }
  34. }