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));
     }
 }
Beispiel #3
0
 public virtual ITextLine Substring(
     ITextLine line,
     int offset,
     int count)
 {
     IDecodedTextLine decodedLine = line.Decode_MustDispose();
     return Encode(decodedLine.Value.Substring(offset, count));
 }
Beispiel #4
0
 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)));
 }