Exemple #1
0
        private void crawlDirectoryTree(ref Folder _rootDirectory)
        {
            serializeAllFiles(ref _rootDirectory, Directory.GetFiles(_rootDirectory.getPath()));

            string[] directories = Directory.GetDirectories(_rootDirectory.getPath());

            foreach (string s in directories)
            {
                Folder f = new Folder(s);
                _rootDirectory.addSubFolder(f);
                crawlDirectoryTree(ref f);
            }
        }
Exemple #2
0
        private void crawlDirectoryTree(string _rootDirectory)
        {
            Folder root = new Folder(_rootDirectory);

            serializeAllFiles(ref root, Directory.GetFiles(_rootDirectory));

            string[] directories = Directory.GetDirectories(_rootDirectory);

            foreach (string s in directories)
            {
                Folder f = new Folder(s);
                root.addSubFolder(f);
                crawlDirectoryTree(ref f);
            }

            List <byte> byteBuffer = new List <byte>();
            UInt32      offset     = sizeof(UInt32);

            getAssetBinaryBlob(root, ref offset, ref byteBuffer);
            getFolderHeaderData(root, ref byteBuffer);

            List <byte> finalByteBuffer = new List <byte>(byteBuffer.Count + sizeof(UInt32));

            finalByteBuffer.AddRange(BitConverter.GetBytes(offset));
            finalByteBuffer.AddRange(byteBuffer);

            if (cb_compress.Checked)
            {
                using (FileStream fs = File.Create(folderPath + "_comp" + fileFormatName))
                {
                    using (GZipStream gz = new GZipStream(fs, CompressionMode.Compress, false))
                    {
                        gz.Write(finalByteBuffer.ToArray(), 0, finalByteBuffer.Count);
                    }
                }
            }
            else
            {
                using (FileStream fs = File.Create(folderPath + fileFormatName))
                {
                    fs.Write(finalByteBuffer.ToArray(), 0, finalByteBuffer.Count);
                }
            }
        }
Exemple #3
0
        private void crawlDirectoryTree(string _rootDirectory)
        {
            Folder root = new Folder(_rootDirectory);
            serializeAllFiles(ref root, Directory.GetFiles(_rootDirectory));

            string[] directories = Directory.GetDirectories(_rootDirectory);
            
            foreach(string s in directories)
            {
                Folder f = new Folder(s);
                root.addSubFolder(f);
                crawlDirectoryTree(ref f);
            }

            List<byte> byteBuffer = new List<byte>();
            UInt32 offset = sizeof(UInt32);
            getAssetBinaryBlob(root, ref offset, ref byteBuffer);
            getFolderHeaderData(root, ref byteBuffer);

            List<byte> finalByteBuffer = new List<byte>(byteBuffer.Count + sizeof(UInt32));
            finalByteBuffer.AddRange(BitConverter.GetBytes(offset));
            finalByteBuffer.AddRange(byteBuffer);

            if(cb_compress.Checked)
            {
                using (FileStream fs = File.Create(folderPath + "_comp" + fileFormatName))
                {
                    using (GZipStream gz = new GZipStream(fs, CompressionMode.Compress, false))
                    {
                        gz.Write(finalByteBuffer.ToArray(), 0, finalByteBuffer.Count);
                    }
                }
            }
            else
            {
                using (FileStream fs = File.Create(folderPath + fileFormatName))
                {
                    fs.Write(finalByteBuffer.ToArray(), 0, finalByteBuffer.Count);
                }
            }
        }
Exemple #4
0
        private void crawlDirectoryTree(ref Folder _rootDirectory)
        {
            serializeAllFiles(ref _rootDirectory, Directory.GetFiles(_rootDirectory.getPath()));

            string[] directories = Directory.GetDirectories(_rootDirectory.getPath());

            foreach (string s in directories)
            {
                Folder f = new Folder(s);
                _rootDirectory.addSubFolder(f);
                crawlDirectoryTree(ref f);
            }
        }