-
Notifications
You must be signed in to change notification settings - Fork 9
/
NormalizedPathRootKind.cs
58 lines (52 loc) · 2.38 KB
/
NormalizedPathRootKind.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.Core;
/// <summary>
/// Characterizes the root of a <see cref="NormalizedPath"/>.
/// </summary>
public enum NormalizedPathRootKind : byte
{
/// <summary>
/// Relative path.
/// </summary>
None = 0,
/// <summary>
/// Marks a path that is rooted because of its <see cref="NormalizedPath.FirstPart"/>.
/// A path that starts with a tilde (~/) is rooted as well as a path whose first ends with a colon (:).
/// <para>
/// When the first part ends with a colon, there's 2 cases:
/// <list type="bullet">
/// <item>The part is ":" alone (length = 1) or "X:" (length = 2): this RootedByFirstPart applies.</item>
/// <item>The part is longer than 3 characters (like "ni:"): this denotes a <see cref="RootedByURIScheme"/> kind.</item>
/// </list>
/// "C:" is RootedByFirstPart whereas "ni:" is <see cref="RootedByURIScheme"/>.
/// </para>
/// </summary>
RootedByFirstPart = 1,
/// <summary>
/// When '/' or '\' starts the path, it is rooted.
/// The <see cref="NormalizedPath.FirstPart"/> does not contain the separator (there can even be
/// no parts at all), but the <see cref="NormalizedPath.Path"/> (and <see cref="NormalizedPath.ToString()"/>)
/// starts with it (normalized to <see cref="NormalizedPath.DirectorySeparatorChar"/>).
/// </summary>
RootedBySeparator = 2,
/// <summary>
/// When double separators ("//" or "\\") starts the path, it is rooted.
/// The <see cref="NormalizedPath.FirstPart"/> does not contain the separators (there can even be
/// no parts at all), but the <see cref="NormalizedPath.Path"/> (and <see cref="NormalizedPath.ToString()"/>)
/// starts with them (normalized to <see cref="NormalizedPath.DirectorySeparatorChar"/>).
/// </summary>
RootedByDoubleSeparator = 3,
/// <summary>
/// When a path starts with "XX:" (at least 3 characters long, including the ending colon), it is considered
/// to be a "URI scheme" ("X:" is <see cref="RootedByFirstPart"/>).
/// <para>
/// With this kind of root, <see cref="NormalizedPath.FirstPart"/> ends with ":/" (this is the only case where a part
/// contains the <see cref="NormalizedPath.DirectorySeparatorChar"/>).
/// </para>
/// </summary>
RootedByURIScheme = 4
}