3
using System.Collections.Generic;
5
namespace Mono.TextEditor
8
/// Simple implementation of the buffer interface to support fast read-only documents.
10
public class StringBuffer : IBuffer
14
public StringBuffer (string buffer)
19
#region IBuffer Members
21
get { return buffer.Length; }
25
get { return buffer; }
26
set { buffer = value; }
29
void IBuffer.Insert (int offset, string value)
31
throw new NotSupportedException ("Operation not supported on this buffer.");
34
void IBuffer.Remove (int offset, int count)
36
throw new NotSupportedException ("Operation not supported on this buffer.");
39
void IBuffer.Remove (ISegment segment)
41
throw new NotSupportedException ("Operation not supported on this buffer.");
44
void IBuffer.Replace (int offset, int count, string value)
46
throw new NotSupportedException ("Operation not supported on this buffer.");
49
string IBuffer.GetTextAt (int offset, int count)
51
return buffer.Substring (offset, count);
54
string IBuffer.GetTextAt (ISegment segment)
56
return buffer.Substring (segment.Offset, segment.Length);
59
char IBuffer.GetCharAt (int offset)
61
return buffer[offset];
64
IEnumerable<int> IBuffer.SearchForward (string pattern, int startIndex)
66
throw new NotImplementedException();
69
IEnumerable<int> IBuffer.SearchForwardIgnoreCase (string pattern, int startIndex)
71
throw new NotImplementedException();
74
IEnumerable<int> IBuffer.SearchBackward (string pattern, int startIndex)
76
throw new NotImplementedException();
79
IEnumerable<int> IBuffer.SearchBackwardIgnoreCase (string pattern, int startIndex)
81
throw new NotImplementedException();