Package org.eclipse.cdt.core
Interface IPositionConverter
public interface IPositionConverter
Allows for converting character ranges of files previously stored on disk to the
range where the characters are found in the current version of the file. The
current version can be the content of a dirty editor, or if there is none, the
latest verison of the file as stored on disk.
As long as the underlying text of the character range has not been modified the
converted range will have the same underlying text. Insertions at the beginning
or the end of the text are not added to the converted range.
An insertion inside the underlying text will increase the length of the converted
range, a deletion of one of the characters will decrease it.
An deletion followed by an insertion without saving the file inbetween, will cancel
the deletion as far as possible.
- Since:
- 4.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jface.text.IRegion
actualToHistoric
(org.eclipse.jface.text.IRegion actualPosition) Converts an actual character range to the range where the underlying text was originally found.org.eclipse.jface.text.IRegion
historicToActual
(org.eclipse.jface.text.IRegion historicPosition) Converts a historic character range to the range where the underlying text currently can be found.
-
Method Details
-
actualToHistoric
org.eclipse.jface.text.IRegion actualToHistoric(org.eclipse.jface.text.IRegion actualPosition) Converts an actual character range to the range where the underlying text was originally found.- Parameters:
actualPosition
- a range as found in the current text buffer for the file.- Returns:
- a range suitable for the version of the file for which the converter was obtained.
-
historicToActual
org.eclipse.jface.text.IRegion historicToActual(org.eclipse.jface.text.IRegion historicPosition) Converts a historic character range to the range where the underlying text currently can be found.- Parameters:
historicPosition
- a range as found in the version of the file for which the converter was obtained.- Returns:
- a range suitable for the current text buffer of the file.
-