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