-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.cs
More file actions
64 lines (55 loc) · 1.46 KB
/
Node.cs
File metadata and controls
64 lines (55 loc) · 1.46 KB
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
59
60
61
62
63
64
using System.Collections.Generic;
namespace AM.InMemoryFileSystemTree
{
/// <summary>
/// Represents a single Node of a Tree
/// </summary>
public class Node
{
/// <summary>
/// Name of the File/Directory
/// </summary>
public string Name { get; set; }
/// <summary>
/// Full path to the File/Directory
/// </summary>
public string Path { get; set; }
/// <summary>
/// Type: [File] or [Directory]
/// </summary>
public NodeType NodeType { get; set; }
/// <summary>
/// Size of the file in bytes
/// </summary>
public long FileSize { get; set; }
/// <summary>
/// Unix time-stamp when Node was created
/// </summary>
public long CreatedAt { get; set; }
/// <summary>
/// Descendants of the Node
/// </summary>
public IList<Node> Nodes { get; set; }
/// <summary>
/// Number of Directories created under certain Directory Node
/// </summary>
public int DirectoryCount { get; set; }
/// <summary>
/// Number of Files created under certain Directory Node
/// </summary>
public int FileCount { get; set; }
/// <summary>
/// Node constructor
/// </summary>
/// <param name="name">Name of the File/Directory</param>
/// <param name="path">Full path to the File/Directory</param>
/// <param name="nodeType">Type of the Node: File or Directory</param>
public Node(string name, string path, NodeType nodeType)
{
Name = name;
Path = path;
NodeType = nodeType;
Nodes = new List<Node>();
}
}
}