-
Notifications
You must be signed in to change notification settings - Fork 4k
/
ITemporaryStorage.cs
51 lines (45 loc) · 2.31 KB
/
ITemporaryStorage.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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable disable
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.CodeAnalysis.Host
{
[Obsolete("Roslyn no longer exports a mechanism to store arbitrary data in-memory.")]
public interface ITemporaryTextStorage : IDisposable
{
SourceText ReadText(CancellationToken cancellationToken = default);
Task<SourceText> ReadTextAsync(CancellationToken cancellationToken = default);
void WriteText(SourceText text, CancellationToken cancellationToken = default);
Task WriteTextAsync(SourceText text, CancellationToken cancellationToken = default);
}
[Obsolete("Roslyn no longer exports a mechanism to store arbitrary data in-memory.")]
public interface ITemporaryStreamStorage : IDisposable
{
Stream ReadStream(CancellationToken cancellationToken = default);
Task<Stream> ReadStreamAsync(CancellationToken cancellationToken = default);
void WriteStream(Stream stream, CancellationToken cancellationToken = default);
Task WriteStreamAsync(Stream stream, CancellationToken cancellationToken = default);
}
/// <summary>
/// TemporaryStorage can be used to read and write text to a temporary storage location.
/// </summary>
internal interface ITemporaryTextStorageInternal : IDisposable
{
SourceText ReadText(CancellationToken cancellationToken = default);
Task<SourceText> ReadTextAsync(CancellationToken cancellationToken = default);
void WriteText(SourceText text, CancellationToken cancellationToken = default);
Task WriteTextAsync(SourceText text, CancellationToken cancellationToken = default);
}
internal interface ITemporaryStreamStorageInternal : IDisposable
{
Stream ReadStream(CancellationToken cancellationToken = default);
Task<Stream> ReadStreamAsync(CancellationToken cancellationToken = default);
void WriteStream(Stream stream, CancellationToken cancellationToken = default);
Task WriteStreamAsync(Stream stream, CancellationToken cancellationToken = default);
}
}