using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Perforce.P4 { /// /// A versioned object that describes an individual file in a Perforce repository. /// public class ReconcileEntry : FileSpec { public FileAction Action; public FileType Type; public Revision WorkRev; public ReconcileEntry() { } public ReconcileEntry( DepotPath depotPath, ClientPath clientPath, LocalPath localPath, Revision workRev, FileAction action, FileType type ) : base(depotPath, clientPath, localPath, workRev) { Action = action; Type = type; WorkRev = workRev; } public override string ToString() { FileSpec.ToStrings(); return base.ToString(); } public void ParseReconcileEntryTaggedData(TaggedObject obj) { if (obj.ContainsKey("depotFile")) { DepotPath = new DepotPath(obj["depotFile"]); } if (obj.ContainsKey("clientFile")) { ClientPath = new ClientPath(obj["clientFile"]); } if (obj.ContainsKey("localFile")) { LocalPath = new LocalPath(obj["localFile"]); } if (obj.ContainsKey("workRev")) { int revision; int.TryParse(obj["workRev"], out revision); WorkRev = new Revision(revision); } if (obj.ContainsKey("action")) { Action = new StringEnum(obj["action"], true, true); } if (obj.ContainsKey("type")) { Type = new FileType(obj["type"]); } } public static ReconcileEntry FromReconcileEntryTaggedData(TaggedObject obj) { ReconcileEntry val = new ReconcileEntry(); val.ParseReconcileEntryTaggedData(obj); return val; } } }