public static Promise <RunResult> BackupAsync(string gameDataPath, CommandOutput output) { if (gameDataPath == null) { throw new ArgumentNullException("gameDataPath"); } if (output == null) { throw new ArgumentNullException("output"); } if (File.Exists(gameDataPath) == false) { throw new IOException(string.Format("GameData file '{0}' doesn't exists.", gameDataPath)); } var runTask = RunInternal ( RunOptions.FlattenArguments( "DATA", "Backup", gameDataPath, "--output", output.Target, "--outputFormat", output.Format, "--outputFormattingOptions", output.FormattingOptions ) ); return(output.Capture(runTask)); }
public static Promise <RunResult> ExportAsync(string gameDataPath, string[] entities, string[] attributes, CultureInfo[] languages, CommandOutput output, ExportMode mode) { if (gameDataPath == null) { throw new ArgumentNullException("gameDataPath"); } if (entities == null) { throw new ArgumentNullException("entities"); } if (attributes == null) { throw new ArgumentNullException("attributes"); } if (languages == null) { throw new ArgumentNullException("languages"); } if (output == null) { throw new ArgumentNullException("output"); } if (Enum.IsDefined(typeof(ExportMode), mode) == false) { throw new ArgumentException("Unknown export mode.", "mode"); } if (File.Exists(gameDataPath) == false) { throw new IOException(string.Format("GameData file '{0}' doesn't exists.", gameDataPath)); } var runTask = RunInternal ( RunOptions.FlattenArguments( "DATA", "EXPORT", gameDataPath, "--entities", entities, "--attributes", attributes, "--languages", Array.ConvertAll(languages, l => l.Name), "--mode", mode, "--output", output.Target, "--outputFormat", output.Format, "--outputFormattingOptions", output.FormattingOptions ) ); return(runTask); }
public static Promise <RunResult> ExportAsync(string gameDataPath, string[] entities, string[] attributes, CommandOutput output, ExportMode mode) { return(ExportAsync(gameDataPath, entities, attributes, new CultureInfo[0], output, mode)); }
public static Promise <RunResult> ExportAsync(string gameDataPath, CommandOutput output, ExportMode mode) { return(ExportAsync(gameDataPath, new string[0], output, mode)); }
public static Promise <RunResult> DeleteDocumentAsync(string gameDataPath, string entity, string id, CommandInput input, CommandOutput output) { if (gameDataPath == null) { throw new ArgumentNullException("gameDataPath"); } if (entity == null) { throw new ArgumentNullException("entity"); } if (id == null) { throw new ArgumentNullException("id"); } if (input == null) { throw new ArgumentNullException("input"); } if (output == null) { throw new ArgumentNullException("output"); } if (File.Exists(gameDataPath) == false) { throw new IOException(string.Format("GameData file '{0}' doesn't exists.", gameDataPath)); } var runTask = RunInternal ( RunOptions.FlattenArguments( "DATA", "DELETE", gameDataPath, "--entity", entity, "--id", id, "--input", input.Source, "--inputFormat", input.Format, "--inputFormattingOptions", input.FormattingOptions, "--output", output.Target, "--outputFormat", output.Format, "--outputFormattingOptions", output.FormattingOptions ) ); input.StickWith(runTask); return(output.Capture(runTask)); }
public static Promise <RunResult> DeleteDocumentAsync(string gameDataPath, string entity, CommandInput input, CommandOutput output) { return(DeleteDocumentAsync(gameDataPath, entity, string.Empty, input, output)); }