Exemplo n.º 1
0
        /// <summary>
        /// Method that is called on start of the program.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            string           inputPath  = default(string);
            string           outputPath = default(string);
            SupremeCommander Thor;

            if (!CheckArguments(args))
            {
                return;
            }
            inputPath  = args[0];
            outputPath = inputPath + ".huff";
            Thor       = SupremeCommander.GetSupremeCommander(inputPath, outputPath);
            if (Thor == null)
            {
                Console.WriteLine("File Error");
                return;
            }
            Thor.CreateHuffmanTree();
            Thor.PrintCodedHuffmanTreeToFile();
            Thor.PrintCodedFileToFile();
            Thor.Dispose();
        }