Exemple #1
0
        private void ReadNode(System.IO.BinaryReader file)
        {
            // Read node info
            mType   = (ENodeType)file.ReadInt32();
            mName   = file.ReadString();
            mOffset = file.ReadInt64();
            int count = file.ReadInt32();

            // Recursively read child nodes
            for (int i = 0; i < count; i++)
            {
                CCatalogNode node = new CCatalogNode();
                mNodes.Add(node);
                node.ReadNode(file);
            }
        }
Exemple #2
0
        /// <summary>
        /// Reads the catalog from the disk.
        /// </summary>
        public static CCatalogNode ReadCatalog(string Filename)
        {
            // Create the root node
            CCatalogNode Node = new CCatalogNode();

            // Open the file
            System.IO.BinaryReader file = new System.IO.BinaryReader(new System.IO.FileStream(Filename, System.IO.FileMode.Open, System.IO.FileAccess.Read));

            // Read backup file name
            file.ReadString();

            // Read nodes
            Node.ReadNode(file);

            // Close the file
            file.Close();

            return(Node);
        }
Exemple #3
0
        private void ReadNode(System.IO.BinaryReader file)
        {
            // Read node info
            mType = (ENodeType)file.ReadInt32();
            mName = file.ReadString();
            mOffset = file.ReadInt64();
            int count = file.ReadInt32();

            // Recursively read child nodes
            for (int i = 0; i < count; i++)
            {
                CCatalogNode node = new CCatalogNode();
                mNodes.Add(node);
                node.ReadNode(file);
            }
        }
Exemple #4
0
        /// <summary>
        /// Reads the catalog from the disk.
        /// </summary>
        public static CCatalogNode ReadCatalog(string Filename)
        {
            // Create the root node
            CCatalogNode Node = new CCatalogNode();

            // Open the file
            System.IO.BinaryReader file = new System.IO.BinaryReader(new System.IO.FileStream(Filename, System.IO.FileMode.Open, System.IO.FileAccess.Read));

            // Read backup file name
            file.ReadString();

            // Read nodes
            Node.ReadNode(file);

            // Close the file
            file.Close();

            return Node;
        }