Ejemplo n.º 1
0
        public static void Process(Context ctx, Romfs romfs)
        {
            if (ctx.Options.ListRomFs)
            {
                foreach (RomfsFile romfsFile in romfs.Files)
                {
                    ctx.Logger.LogMessage(romfsFile.FullPath);
                }
            }

            if (ctx.Options.RomfsOut != null)
            {
                using (var outFile = new FileStream(ctx.Options.RomfsOut, FileMode.Create, FileAccess.ReadWrite))
                {
                    IStorage romfsStorage = romfs.OpenRawStream();
                    romfsStorage.CopyToStream(outFile, romfsStorage.Length, ctx.Logger);
                }
            }

            if (ctx.Options.RomfsOutDir != null)
            {
                romfs.Extract(ctx.Options.RomfsOutDir, ctx.Logger);
            }
        }