Example #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;
            }
        }
Example #2
0
 protected VfsFile(string name, VfsDevice device, VfsEntry parent = null)
     : base(name, device, parent)
 {
 }
Example #3
0
 internal void AddChild(VfsEntry childEntry)
 => _children.TryAdd(childEntry.Name, childEntry);
Example #4
0
 public bool TryGetChild(string name, out VfsEntry child)
 => _children.TryGetValue(name, out child);