00001 namespace JLibDiff
00002 {
00003 using System;
00004
00005
00006
00007
00008
00009 [Serializable]
00010 public class HunkDel:Hunk
00011 {
00012
00013 internal int ld1;
00014 internal int lf1;
00015 internal int ld2;
00016
00017 internal System.Collections.ArrayList a = new System.Collections.ArrayList();
00018
00019 public override void accept(HunkVisitor visitor)
00020 {
00021 visitor.visitHunkDel(this);
00022 }
00023
00024
00025
00026
00027
00028 public virtual System.String getOldContents()
00029 {
00030 System.String s = new System.String("".ToCharArray());
00031
00032 for (System.Collections.IEnumerator e = a.GetEnumerator(); e.MoveNext(); )
00033 {
00034
00035 s = System.String.Concat(s, (System.String) e.Current);
00036 }
00037 return s;
00038 }
00039
00040
00041
00042
00043
00044 public override System.String convert()
00045 {
00046 System.String s = new System.String(System.Convert.ToString(ld1).ToCharArray());
00047 if (ld1 != lf1)
00048 s = System.String.Concat(s, "," + lf1);
00049 s = System.String.Concat(s, "d" + ld2 + "\n");
00050
00051 for (System.Collections.IEnumerator e = a.GetEnumerator(); e.MoveNext(); )
00052 {
00053
00054 s = System.String.Concat(s, "< " + (System.String) e.Current);
00055 }
00056 return s;
00057 }
00058
00059
00060
00061
00062
00063 public override System.String convert_ED()
00064 {
00065 System.String s = new System.String(System.Convert.ToString(ld1).ToCharArray());
00066 if (ld1 != lf1)
00067 s = System.String.Concat(s, "," + lf1);
00068 s = System.String.Concat(s, "d\n");
00069 return s;
00070 }
00071
00072
00073
00074
00075
00076 public override System.String convert_RCS()
00077 {
00078 System.String s = new System.String(("d" + ld1 + " " + (lf1 - ld1 + 1) + "\n").ToCharArray());
00079 return s;
00080 }
00081
00082
00083
00084
00085
00086
00087
00088 public override int lowLine(int filenum)
00089 {
00090 if (filenum == 0)
00091 return ld1;
00092 else
00093 return ld2;
00094 }
00095
00096
00097
00098
00099
00100
00101
00102 public override int highLine(int filenum)
00103 {
00104 if (filenum == 0)
00105 return lf1;
00106 else
00107 return ld2;
00108 }
00109
00110
00111
00112
00113
00114
00115
00116 public override int numLines(int filenum)
00117 {
00118 if (filenum == 0)
00119 return (lf1 - ld1 + 1);
00120 else
00121 return 1;
00122 }
00123
00124
00125
00126
00127
00128
00129
00130
00131 public override System.String relNum(int filenum, int linenum)
00132 {
00133 if (filenum == 0)
00134 return (System.String) a[linenum];
00135 else
00136 return null;
00137 }
00138 }
00139 }