aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Engine/ShiftFS/ShiftDrive.cs
blob: cde9e8de5d155a3362163bc9892d81ec1e50abc6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.IO;
using ShiftOS.Engine.Misc;

namespace ShiftOS.Engine.ShiftFS
{
	public class ShiftDrive
	{
		internal ShiftDrive(DirectoryInfo dir)
		{
			Label = dir.Name;
			var file = new IniFile(Path.Combine(dir.FullName, "driveinfo.ini"));
			Letter = char.TryParse(file.ReadValue("", "DriveLetter"), out var letter) ? letter : '?';
			Contents = new ShiftDirectory(dir.FullName);
		}

		public string Label { get; }
		public char Letter { get; }
		public ShiftDirectory Contents { get; }
	}
}