public WriteLine ( |
||
@out | ||
i | int | /// index of the line to extract. Note this is 0-based, so line /// number 1 is actually index 0. /// |
return | void |
public virtual void TestWriteLine1() { RawText a = new RawText(Constants.EncodeASCII("foo-a\nfoo-b\n")); ByteArrayOutputStream o = new ByteArrayOutputStream(); a.WriteLine(o, 0); byte[] r = o.ToByteArray(); NUnit.Framework.Assert.AreEqual("foo-a", RawParseUtils.Decode(r)); }
public virtual void TestWriteLine2() { RawText a = new RawText(Constants.EncodeASCII("foo-a\nfoo-b")); ByteArrayOutputStream o = new ByteArrayOutputStream(); a.WriteLine(o, 1); byte[] r = o.ToByteArray(); NUnit.Framework.Assert.AreEqual("foo-b", RawParseUtils.Decode(r)); }
/// <summary>Write a standard patch script line.</summary> /// <remarks>Write a standard patch script line.</remarks> /// <param name="prefix">prefix before the line, typically '-', '+', ' '.</param> /// <param name="text">the text object to obtain the line from.</param> /// <param name="cur">line number to output.</param> /// <exception cref="System.IO.IOException">the stream threw an exception while writing to it. /// </exception> protected internal virtual void WriteLine(char prefix, RawText text, int cur) { @out.Write(prefix); text.WriteLine(@out, cur); @out.Write('\n'); }
public virtual void TestWriteLine3() { RawText a = new RawText(Constants.EncodeASCII("a\n\nb\n")); ByteArrayOutputStream o = new ByteArrayOutputStream(); a.WriteLine(o, 1); byte[] r = o.ToByteArray(); NUnit.Framework.Assert.AreEqual(string.Empty, RawParseUtils.Decode(r)); }