-
Notifications
You must be signed in to change notification settings - Fork 374
/
Copy pathSymbolStoreFile.cs
55 lines (50 loc) · 1.71 KB
/
SymbolStoreFile.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Diagnostics;
using System.IO;
namespace Microsoft.SymbolStore
{
/// <summary>
/// Symbol store file.
///
/// Key generation: input file stream and file name/path.
/// Symbol store: output file stream and the file name/path it came.
/// </summary>
public sealed class SymbolStoreFile : IDisposable
{
/// <summary>
/// The input file stream to generate the key or the output file stream
/// for the symbol stores to write.
/// </summary>
public readonly Stream Stream;
/// <summary>
/// The name of the input file for key generation or the name of where
/// the output file came for symbol stores i.e. cached file name, file.ptr
/// UNC path or http request URL.
/// </summary>
public readonly string FileName;
/// <summary>
/// Create a symbol file instance
/// </summary>
/// <param name="stream">stream of the file contents</param>
/// <param name="fileName">name of the file</param>
public SymbolStoreFile(Stream stream, string fileName)
{
if (stream is null || !stream.CanSeek)
{
throw new ArgumentException("Stream null or not seekable", nameof(stream));
}
if (fileName is null or "")
{
throw new ArgumentNullException(nameof(fileName));
}
Stream = stream;
FileName = fileName;
}
public void Dispose()
{
Stream.Dispose();
}
}
}