AbsRelPaths

References
public sealed class AbsRelPaths : IEquatable<AbsRelPaths>
A pair consisting of an absolute and relative path on a file system.

Constructors

AbsRelPaths

#
Create a new file path. Arguments may not both be null. If both are specified, it is up to the caller to ensure they are mutually correct.
public AbsRelPaths(
absolute,
Absolute path.
relative
Relative path.
)
ArgumentNullExceptionThrown if both the uris are null.

Properties

Absolute

#
Gets the absolute path. If null, the relative path will be set.
public FileSystemPath Absolute { get; }

FileExtension

#
Gets the file extension as specified by either path.
public string FileExtension { get; }

FileName

#
Gets the filename as specified by either path.
public string FileName { get; }

HasAbsolute

#
Gets whether the Absolute uri has been set.
public bool HasAbsolute { get; }

HasBoth

#
Gets whether both the Absolute and Relative uris have been set.
public bool HasBoth { get; }

HasRelative

#
Gets whether the Relative uri has been set.
public bool HasRelative { get; }

Relative

#
Gets the relative path. If null, the absolute path will be set.
public FileSystemPath Relative { get; }

Methods

Equals

#
public bool Equals()

Equals

#
public override bool Equals(
obj
)
Object.Equals

FromAbsolute

#
Create a path pair from an absolute file path and a base uri.
public static AbsRelPaths FromAbsolute(
absolute,
origin = null
)

GetHashCode

#
public override int GetHashCode()

Resolve

#
Resolve the absolute paths implied by this pair.
public string Resolve(
origin,
Origin, required to resolve the relative path.
out string
absolute,
The absolute path, if available.
out string
relative,
The absolute path as implied by the origin and the relative path.
out bool
absoluteExists,
If the 'absolute' path was set, a value indicating whether there's a file there.
out bool
relativeExists
If the 'relative' path was resolved, a value indicating whether there's a file there.
)
The suggested path. This is the relative path if it can be resolved and points to an existing file, otherwise it's the absolute path if it points to an existing file. If neither path specify a file, null is returned.

Resolve

#
Resolve the absolute paths implied by this pair.
public string Resolve(
origin,
Origin, required to resolve the relative path.
out string
absolute,
The absolute path, if available.
out string
relative
The absolute path as implied by the origin and the relative path.
)
The suggested path. This is always the relative path if it can be resolved.

ToString

#
public override string ToString()
Object.ToString

WithRelative

#
If this pair contains an absolute but not a relative uri, create a new pair with a relative Uri from the baseUri to the Absolute uri.
public AbsRelPaths WithRelative(
origin
Base uri.
)
This pair, or a pair with a specified relative uri.