using System.Diagnostics;
using System.Globalization;
using System.Text;
namespace LibGit2Sharp
{
///
/// Base class for changes.
///
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public abstract class Changes
{
private readonly StringBuilder patchBuilder = new StringBuilder();
internal void AppendToPatch(string patch)
{
patchBuilder.Append(patch);
}
///
/// The number of lines added.
///
public virtual int LinesAdded { get; internal set; }
///
/// The number of lines deleted.
///
public virtual int LinesDeleted { get; internal set; }
///
/// The patch corresponding to these changes.
///
public virtual string Patch
{
get { return patchBuilder.ToString(); }
}
///
/// Determines if at least one side of the comparison holds binary content.
///
public virtual bool IsBinaryComparison { get; protected set; }
private string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture,
@"{{+{0}, -{1}}}", LinesAdded, LinesDeleted);
}
}
}
}