public static CommandContext Create(CommandContext parent, FileInfo fileInfo, TagCache cache, HaloTag tag, VFilesList vfsl) { var context = new CommandContext(parent, string.Format("{0:X8}.vfsl", tag.Index)); context.AddCommand(new VfslListCommand(vfsl)); context.AddCommand(new VfslExtractCommand(vfsl)); context.AddCommand(new VfslExtractAllCommand(vfsl)); context.AddCommand(new VfslImportCommand(fileInfo, cache, tag, vfsl)); context.AddCommand(new VfslImportAllCommand(fileInfo, cache, tag, vfsl)); return context; }
public VfslExtractAllCommand(VFilesList list) : base(CommandFlags.Inherit, "extractall", "Extract all files from the tag", "extractall [output path]", "If not output path is specified, files will be extracted to the current\n" + "directory.") { _list = list; }
public VfslListCommand(VFilesList list) : base(CommandFlags.Inherit, "list", "List files stored in the tag", "list [filter]", "If a filter is specified, only files which contain the filter in their path\n" + "will be listed.") { _list = list; }
public VfslImportCommand(FileInfo fileInfo, TagCache cache, HaloTag tag, VFilesList list) : base(CommandFlags.None, "import", "Replace a file stored in the tag", "import <virtual path> [filename]", "Replaces a file stored in the tag. The tag will be resized as necessary.") { _fileInfo = fileInfo; _cache = cache; _tag = tag; _list = list; }
public VfslExtractCommand(VFilesList list) : base(CommandFlags.Inherit, "extract", "Extract a file from the tag", "extract <virtual path> [output path]", "Extracts a file stored in the tag. If the output path is not specified, it will\n" + "be the same as the file's virtual path.\n" + "\n" + "Use \"list\" to find files in the tag.") { _list = list; }
public VfslImportAllCommand(FileInfo fileInfo, TagCache cache, HaloTag tag, VFilesList list) : base(CommandFlags.None, "importall", "Replace all files stored in the tag", "importall [directory]", "Replaces all file stored in the tag. The tag will be resized as necessary.\n" + "If no directory is specified, files will be loaded from the current directory.") { _fileInfo = fileInfo; _cache = cache; _tag = tag; _list = list; }