Exemplo n.º 1
0
 static void DumpGT2Toc(string[] args)
 {
     if (!File.Exists(args[1]))
     {
         Console.Error.WriteLine("VOL file '{0}' doesn't exist!", args[1]);
         return;
     }
     using (VolFile theVol = new VolFile(args[1]))
     {
         if (!theVol.CheckAndCacheHeaderDetails())
         {
             Console.WriteLine("File is not a GT2.vol (incorrect GTFS signature, not enough entries, or total entries less than files)");
             return;
         }
         theVol.ParseToc(new VolFile.TocFileNotify(EmbeddedFileNotify));
     }
 }
Exemplo n.º 2
0
        static void ExplodeVol(string[] args)
        {
            bool decompGZ = (args.Length >= 4);

            if (!File.Exists(args[1]))
            {
                Console.Error.WriteLine("VOL file '{0}' doesn't exist!", args[1]);
                return;
            }
            using (VolFile theVol = new VolFile(args[1]))
            {
                if (!theVol.CheckAndCacheHeaderDetails())
                {
                    Console.WriteLine("File is not a GT2.vol (incorrect GTFS signature, not enough entries, or total entries less than files)");
                    return;
                }
                theVol.ParseToc(new VolFile.TocFileNotify(EmbeddedFileNotify));
                theVol.Explode(args[2], decompGZ, new VolFile.ExplodeProgressCallback(WriteToConsole));
            }
        }
Exemplo n.º 3
0
 public WorkUnit(
     string dir,
     EmbeddedFileInfo efiParam,
     VolFile volFile,
     bool decompGZ,
     ManualResetEvent compEvent,
     ExplodeProgressCallback epc
     )
 {
     efi      = efiParam;
     destFile = new FileStream(
         Path.Combine(dir, efi.name),
         FileMode.Create,
         FileAccess.ReadWrite,
         FileShare.None,
         8192,
         false
         );
     fileVolAddress    = volFile.volMappingAddrAsNum + efi.fileAddress;
     shouldDecompAfter = (decompGZ && efi.name.EndsWith(".gz"));
     finishedHandle    = compEvent;
     callback          = epc;
 }