Esempio n. 1
0
        public XPBurnIStorage CreateStorageDirectory(string storageName)
        {
            XPBurnIStorage storage = new XPBurnIStorage(storageName);

            fSubStorages.Add(storageName, storage);

            return(storage);
        }
Esempio n. 2
0
        private void WriteStream(XPBurnIStorage storage, string streamName)
        {
            string fileToWrite = (string)fFileNames[fFileListOffset];

            if (File.Exists(fileToWrite))
            {
                string shortName = Path.GetFileName(streamName);
                storage.CreateFileStream(fileToWrite, shortName);
            }
        }
Esempio n. 3
0
        private void StreamHelper(XPBurnIStorage storage, string path, string filename)
        {
            string         nestedFilename;
            string         subStorageName;
            string         pathRoot = "";
            string         filePath;
            int            index;
            XPBurnIStorage newStorage;

            if (Path.IsPathRooted(filename))
            {
                pathRoot = Path.GetPathRoot(filename);
                filePath = filename.Remove(filename.IndexOf(pathRoot), pathRoot.Length);
            }
            else
            {
                filePath = filename;
            }

            index = filePath.IndexOf(Path.DirectorySeparatorChar);
            if (index != -1)
            {
                nestedFilename = filePath.Substring(index + 1, filePath.Length - (index + 1));
                subStorageName = filePath.Substring(0, index);

                newStorage = storage.CreateStorageDirectory(subStorageName);

                StreamHelper(newStorage, path + subStorageName + Path.DirectorySeparatorChar, nestedFilename);
            }
            else
            {
                WriteStream(storage, filePath);
                fFileListOffset++;
            }
            if (fFileListOffset < fFileNames.Count)
            {
                if (path != "")
                {
                    nestedFilename = (string)fFiles[fFileNames[fFileListOffset]];
                    index          = nestedFilename.IndexOf(path);
                    if (index != -1)
                    {
                        StreamHelper(storage, path, nestedFilename.Substring(index + path.Length, nestedFilename.Length - (index + path.Length)));
                    }
                }
            }
        }
Esempio n. 4
0
        private void CreateIStorage()
        {
            fRootStorage = new XPBurnIStorage("RootStorage");

            fFileNames = new ArrayList(fFiles.Count);
            foreach (string filename in fFiles.Keys)
            {
                fFileNames.Add(filename);
            }

            fFileListOffset = 0;
            fFileNames.Sort();

            fBuffer = new byte[1048576];
            while (fFileListOffset < fFileNames.Count)
            {
                StreamHelper(fRootStorage, "", (string)fFileNames[fFileListOffset]);
            }
        }
 public XPBurnEnumStorageElements(XPBurnIStorage storage)
 {
     fStreamEnumerator  = null;
     fStorageEnumerator = null;
     fStorage           = storage;
 }