mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Expose more pieces of ArchiveModelManager
via interfaces
This commit is contained in:
36
osu.Game/Database/IModelFileManager.cs
Normal file
36
osu.Game/Database/IModelFileManager.cs
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.IO;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public interface IModelFileManager<in TModel, in TFileModel>
|
||||
where TModel : class
|
||||
where TFileModel : class
|
||||
{
|
||||
/// <summary>
|
||||
/// Replace an existing file with a new version.
|
||||
/// </summary>
|
||||
/// <param name="model">The item to operate on.</param>
|
||||
/// <param name="file">The existing file to be replaced.</param>
|
||||
/// <param name="contents">The new file contents.</param>
|
||||
/// <param name="filename">An optional filename for the new file. Will use the previous filename if not specified.</param>
|
||||
void ReplaceFile(TModel model, TFileModel file, Stream contents, string filename = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete an existing file.
|
||||
/// </summary>
|
||||
/// <param name="model">The item to operate on.</param>
|
||||
/// <param name="file">The existing file to be deleted.</param>
|
||||
void DeleteFile(TModel model, TFileModel file);
|
||||
|
||||
/// <summary>
|
||||
/// Add a new file.
|
||||
/// </summary>
|
||||
/// <param name="model">The item to operate on.</param>
|
||||
/// <param name="contents">The new file contents.</param>
|
||||
/// <param name="filename">The filename for the new file.</param>
|
||||
void AddFile(TModel model, Stream contents, string filename);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user