public override ITextLine Ensure(ITextLine line) { if (line is StringStorageLine) { return line; } else { IDecodedTextLine decodedLine = line.Decode_MustDispose(); return new StringStorageLine(decodedLine.Value); } }
public override ITextLine Ensure(ITextLine line) { if (line is Utf8GapStorageLine) { return line; } else { IDecodedTextLine decodedLine = line.Decode_MustDispose(); return new Utf8GapStorageLine(Encoding.UTF8.GetBytes(decodedLine.Value)); } }
public virtual ITextLine Substring( ITextLine line, int offset, int count) { IDecodedTextLine decodedLine = line.Decode_MustDispose(); return Encode(decodedLine.Value.Substring(offset, count)); }
public virtual ITextLine Combine( ITextLine lineA, int offsetA, int countA, ITextLine lineB, ITextLine lineC, int offsetC, int countC) { IDecodedTextLine decodedLineA = lineA.Decode_MustDispose(); IDecodedTextLine decodedLineB = lineB != null ? lineB.Decode_MustDispose() : null; IDecodedTextLine decodedLineC = lineC.Decode_MustDispose(); return Encode( String.Concat( decodedLineA.Value.Substring(offsetA, countA), decodedLineB != null ? decodedLineB.Value : String.Empty, decodedLineC.Value.Substring(offsetC, countC))); }