~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/Misc/SearchAndReplace/Project/Engine/TextIterator/ITextIterator.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using ICSharpCode.SharpDevelop.Editor;
 
5
using System;
 
6
using ICSharpCode.SharpDevelop.Dom.Refactoring;
 
7
 
 
8
namespace SearchAndReplace
 
9
{
 
10
        /// <summary>
 
11
        /// This iterator iterates on a text buffer strategy.
 
12
        /// </summary>
 
13
        public interface ITextIterator
 
14
        {
 
15
                /// <value>
 
16
                /// The text buffer strategy
 
17
                /// </value>
 
18
                IDocument Document {
 
19
                        get;
 
20
                }
 
21
                
 
22
                /// <value>
 
23
                /// Gets the current char this is the same as 
 
24
                /// GetCharRelative(0)
 
25
                /// </value>
 
26
                /// <exception cref="System.InvalidOperationException">
 
27
                /// If this method is called before the first MoveAhead or after 
 
28
                /// MoveAhead or after MoveAhead returns false.
 
29
                /// </exception>
 
30
                char Current {
 
31
                        get;
 
32
                }
 
33
                
 
34
                /// <value>
 
35
                /// The current position=offset of the text iterator cursor
 
36
                /// </value>
 
37
                int Position {
 
38
                        get;
 
39
                        set;
 
40
                }
 
41
                
 
42
                /// <remarks>
 
43
                /// Gets a char relative to the current position (negative values
 
44
                /// will work too).
 
45
                /// </remarks>
 
46
                /// <exception cref="System.InvalidOperationException">
 
47
                /// If this method is called before the first MoveAhead or after 
 
48
                /// MoveAhead or after MoveAhead returns false.
 
49
                /// </exception>
 
50
                char GetCharRelative(int offset);
 
51
                
 
52
                /// <remarks>
 
53
                /// Moves the iterator position numChars
 
54
                /// </remarks>
 
55
                bool MoveAhead(int numChars);
 
56
                
 
57
                /// <remarks>
 
58
                /// Rests the iterator
 
59
                /// </remarks>
 
60
                void Reset();
 
61
                
 
62
                /// <remarks>
 
63
                /// The find object calls the InformReplace method to inform the text iterator
 
64
                /// about the replace operation on the TextBuffer. The text iterator must update
 
65
                /// all internal offsets to the new offsets (if neccessary)
 
66
                /// </remarks>
 
67
                void InformReplace(int offset, int length, int newLength);
 
68
        }
 
69
}