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