// Copyright Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using AutomationTool; using UnrealBuildTool; using System.Linq; using System.Text.RegularExpressions; namespace Gauntlet { public class GauntletCommandLine { public string Project; public string GameMap; private Dictionary Params; private HashSet NonOptionParams; // Give external people read-only access public IReadOnlyDictionary Arguments { get { return Params; } } /// /// String containing extra commandline args that do not conform to UE commandline arg specs. /// Please do not use this for for standard flags. /// public string AdditionalExplicitCommandLineArgs; public GauntletCommandLine() { Project = string.Empty; GameMap = string.Empty; AdditionalExplicitCommandLineArgs = string.Empty; Params = new Dictionary(StringComparer.OrdinalIgnoreCase); NonOptionParams = new HashSet(StringComparer.OrdinalIgnoreCase); } // copy constructor public GauntletCommandLine(GauntletCommandLine InCopy) { Project = InCopy.Project; GameMap = InCopy.GameMap; AdditionalExplicitCommandLineArgs = InCopy.AdditionalExplicitCommandLineArgs; Params = new Dictionary(InCopy.Params, StringComparer.OrdinalIgnoreCase); NonOptionParams = new HashSet(StringComparer.OrdinalIgnoreCase); } /// /// Breaks down a raw commandline and adds it to the commandline dictionary. /// Will override current set values in the dictionary when conflicts arise. /// /// /// public void AddRawCommandline(string InRawCommandline, bool bOverrideExistingValues = true) { // turn Name(p1,etc) into a collection of Name|(p1,etc) groups MatchCollection Matches = Regex.Matches(InRawCommandline, "-(?