mirror of
https://github.com/ppy/osu.git
synced 2024-12-21 03:12:54 +08:00
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||
|
|
||
|
using System.Collections.Generic;
|
||
|
using System.IO;
|
||
|
|
||
|
namespace osu.Game.IO.Archives
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Reads a file on disk as an archive.
|
||
|
/// Note: In this case, the file is not an extractable archive, use <see cref="ZipArchiveReader"/> instead.
|
||
|
/// </summary>
|
||
|
public class LegacyFileArchiveReader : ArchiveReader
|
||
|
{
|
||
|
private readonly string path;
|
||
|
|
||
|
public LegacyFileArchiveReader(string path)
|
||
|
: base(Path.GetFileName(path))
|
||
|
{
|
||
|
// re-get full path to standardise
|
||
|
this.path = Path.GetFullPath(path);
|
||
|
}
|
||
|
|
||
|
public override Stream GetStream(string name) => File.OpenRead(path);
|
||
|
|
||
|
public override void Dispose()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public override IEnumerable<string> Filenames => new[] { Name };
|
||
|
|
||
|
public override Stream GetUnderlyingStream() => null;
|
||
|
}
|
||
|
}
|