Example #1
0
        public static bool TryGetDevice(FileType fileType, Stream stream, out VfsDevice device)
        {
            device = null;

            if (fileType == FileType.GZip)
            {
                device = new GZipArchiveDevice(stream);
            }
            else if (fileType == FileType.Iso9660)
            {
                device = new Iso9960Device(stream);
            }
            else if (fileType == FileType.Rar)
            {
                device = new RarArchiveDevice(stream);
            }
            else if (fileType == FileType.SevenZip)
            {
                device = new SevenZipArchiveDevice(stream);
            }
            else if (fileType == FileType.Tar)
            {
                device = new TarArchiveDevice(stream);
            }
            else if (fileType == FileType.Zip)
            {
                device = new ZipArchiveDevice(stream);
            }

            return(device != null);
        }
Example #2
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 #3
0
 protected VfsFile(string name, VfsDevice device, VfsEntry parent = null)
     : base(name, device, parent)
 {
 }