Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Storage/IStorageProvider.cs
Ben Marsh 6f927647b1 Changing C# code over to using EpicGames.Core over DotNETCommon.
#rb none
#rnx

[CL 14962096 by Ben Marsh in ue5-main branch]
2020-12-21 23:07:37 -04:00

67 lines
1.5 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using EpicGames.Core;
namespace UnrealBuildTool.Storage
{
/// <summary>
/// Interface for reads from content-addressible storage
/// </summary>
interface IStorageReader : IDisposable
{
/// <summary>
/// Accessor for the read stream
/// </summary>
Stream? Stream { get; }
/// <summary>
/// Whether the reader contains any data
/// </summary>
bool IsValid { get; }
}
/// <summary>
/// Interface for writes to content-addressible storage
/// </summary>
interface IStorageWriter : IDisposable
{
/// <summary>
/// Accessor for the write stream
/// </summary>
Stream? Stream { get; }
/// <summary>
/// Commits the written data to the cache
/// </summary>
void Commit();
}
/// <summary>
/// Interface for an artifact cache
/// </summary>
interface IStorageProvider
{
/// <summary>
/// Attempts to open a file from the output cache
/// </summary>
/// <param name="Digest">Digest of the item to retrieve</param>
/// <returns>True if the item exists in the cache, false otherwise</returns>
IStorageReader CreateReader(ContentHash Digest);
/// <summary>
/// Opens a stream for writing into the cache. The digest
/// </summary>
/// <returns></returns>
IStorageWriter CreateWriter(ContentHash Digest);
}
}