Esempio n. 1
0
 private VFSHandle(string filename, VFSHandle parent, long offset, long size)
 {
     this.parent   = parent;
     this.mmf      = null;
     this.offset   = offset;
     this.size     = size;
     this.filename = filename;
 }
Esempio n. 2
0
        public bool AddMix(string filename, MixFileVersion mixver)
        {
            VFSHandle handle = this.Resolve(filename);

            if (handle != null)
            {
                this.folders.Add(new MixArchive(handle, mixver));
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
        public VFSHandle Resolve(string filename)
        {
            foreach (VFSFolder folder in this.folders)
            {
                VFSHandle handle = folder.Resolve(filename);
                if (handle != null)
                {
                    return(handle);
                }
            }

            return(null);
        }
Esempio n. 4
0
        public VFSHandle(string filename)
        {
            FileInfo fi = new FileInfo(filename);

            this.parent = null;
            this.mmf    = MemoryMappedFile.CreateFromFile(
                File.Open(fi.FullName, FileMode.Open, FileAccess.Read, FileShare.Read),
                null,
                0,
                MemoryMappedFileAccess.Read,
                HandleInheritability.None,
                false
                );
            this.offset   = 0;
            this.size     = fi.Length;
            this.filename = filename;
        }