Exemple #1
0
        protected VfsEntry(string name, VfsDevice device, VfsEntry parent = null)
        {
            _device   = device;
            _parent   = parent;
            _children = new Dictionary <string, VfsEntry>();

            _name = name;

            if (parent != null)
            {
                _path = Path.Combine(parent._path, _name);
                parent.AddChild(this);
            }
            else
            {
                _path = _name;
            }
        }
Exemple #2
0
 protected VfsFile(string name, VfsDevice device, VfsEntry parent = null)
     : base(name, device, parent)
 {
 }
Exemple #3
0
 internal void AddChild(VfsEntry childEntry)
 => _children.TryAdd(childEntry.Name, childEntry);
Exemple #4
0
 public bool TryGetChild(string name, out VfsEntry child)
 => _children.TryGetValue(name, out child);