This commit is contained in:
mikebarnett_cp 2015-10-08 10:06:34 -07:00
Родитель f286357e2e
Коммит c1d8a9f6b9
1 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -12,6 +12,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.SymbolStore;
using System.IO;
using System.Linq;
using Microsoft.Cci.MetadataReader;
namespace Microsoft.Cci {
@ -74,6 +75,25 @@ namespace Microsoft.Cci {
source.Dispose();
}
/// <summary>
/// Gets all source files that this pdb file is referencing.
/// </summary>
/// <returns></returns>
public IEnumerable<string> GetSourceFiles() {
Contract.Ensures(Contract.Result<IEnumerable<string>>() != null);
Contract.Ensures(Contract.ForAll(Contract.Result<IEnumerable<string>>(), item => item != null));
return pdbFunctionMap.Values
.Select(pdbFunc => pdbFunc.lines)
.Where(lines => lines != null)
.SelectMany(lines => lines)
.Where(lines => lines != null)
.Select(lines => lines.file)
.Where(file => file != null)
.Select(file => file.name)
.Where(fileName => fileName != null)
.Distinct();
}
/// <summary>
/// Return zero or more locations in primary source documents that correspond to one or more of the given derived (non primary) document locations.
/// </summary>