Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.ExtLibs/HeuristicLab.Cecil/0.9.5/Mono.Cecil-0.9.5/Symbols/Mono.Cecil.Pdb/Microsoft.Cci.Pdb/MsfDirectory.cs @ 13825

Last change on this file since 13825 was 11700, checked in by jkarder, 10 years ago

#2077: created branch and added first version

File size: 1.3 KB
Line 
1//-----------------------------------------------------------------------------
2//
3// Copyright (C) Microsoft Corporation.  All Rights Reserved.
4//
5//-----------------------------------------------------------------------------
6using System;
7
8namespace Microsoft.Cci.Pdb {
9  internal class MsfDirectory {
10    internal MsfDirectory(PdbReader reader, PdbFileHeader head, BitAccess bits) {
11      bits.MinCapacity(head.directorySize);
12      int pages = reader.PagesFromSize(head.directorySize);
13
14      // 0..n in page of directory pages.
15      reader.Seek(head.directoryRoot, 0);
16      bits.FillBuffer(reader.reader, pages * 4);
17
18      DataStream stream = new DataStream(head.directorySize, bits, pages);
19      bits.MinCapacity(head.directorySize);
20      stream.Read(reader, bits);
21
22      // 0..3 in directory pages
23      int count;
24      bits.ReadInt32(out count);
25
26      // 4..n
27      int[] sizes = new int[count];
28      bits.ReadInt32(sizes);
29
30      // n..m
31      streams = new DataStream[count];
32      for (int i = 0; i < count; i++) {
33        if (sizes[i] <= 0) {
34          streams[i] = new DataStream();
35        } else {
36          streams[i] = new DataStream(sizes[i], bits,
37                                      reader.PagesFromSize(sizes[i]));
38        }
39      }
40    }
41
42    internal DataStream[] streams;
43  }
44
45}
Note: See TracBrowser for help on using the repository browser.