Tanoda
ItemWithStream.cs
Go to the documentation of this file.
1using System.IO;
2
3namespace TriLibCore.SFB
4{
6 public class ItemWithStream
7 {
9 public string Name { get; set; }
10
12 public Stream Stream { private get; set; }
13
17 public bool HasData => Name != null || Stream != null;
18
24 {
25 if (Stream == null && Name != null) return File.OpenRead(Name);
26 return Stream;
27 }
28 }
29}
Represents a platform-specific file with a Stream.
string Name
Gets/Sets the item filename.
Stream Stream
Sets the item file Stream.
Stream OpenStream()
Opens the Stream to read data from this item.
bool HasData
Indicates if this item has valid data.