XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESystem

【Rust】XFE系统,基于Rust和汇编

公开
关注 0 Fork 0 Star 0
UTF-8
using XFESystem.Core;

namespace XFESystem.Documents;

/// <summary>A path in XFESystem's filesystem, never a Windows or Unix host path.</summary>
public sealed record DocumentLocation
{
    public string Value { get; }

    public DocumentLocation(string value)
    {
        ArgumentException.ThrowIfNullOrWhiteSpace(value);
        var normalized = SystemPaths.Normalize(value);
        if (normalized == SystemPaths.Root || value.EndsWith('\\'))
            throw new ArgumentException("A document path must name a file in XFESystem's X: drive.", nameof(value));
        Value = normalized;
    }

    public override string ToString() => Value;
}