|
From: <bl...@us...> - 2003-05-16 19:55:27
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring
In directory sc8-pr-cvs1:/tmp/cvs-serv32133/include/rfta/refactoring
Modified Files:
LineBasedTextDocument.h PlainTextDocument.h TextDocument.h
Log Message:
* Made the interface of TextDocument simpler. It now has only 3 methods: getAllText(), getTextRange() and replaceTextRange().
Index: LineBasedTextDocument.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/LineBasedTextDocument.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** LineBasedTextDocument.h 25 Dec 2002 22:39:46 -0000 1.6
--- LineBasedTextDocument.h 16 May 2003 19:54:53 -0000 1.7
***************
*** 77,80 ****
--- 77,88 ----
void setSelectionRange( const SourceRange &selection );
+ virtual const std::string getSelection() const =0;
+
+ std::string getTextRange( const Refactoring::SourceRange &range );
+
+ void replaceTextRange( const Refactoring::SourceRange &range,
+ const std::string &text );
+
+
protected:
void initialize( const std::string &initialContent );
Index: PlainTextDocument.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/PlainTextDocument.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PlainTextDocument.h 22 Dec 2002 16:03:50 -0000 1.3
--- PlainTextDocument.h 16 May 2003 19:54:53 -0000 1.4
***************
*** 34,65 ****
const std::string getAllText() const;
! /*! Gets the selected text.
! * \return Selected text. EOL are in the original text format.
! */
! const std::string getSelection() const;
!
! /*! Replace current selection text with the specified text.
! * \param text The selection is replaced with that text. If no
! * text is selected, then the specified text is
! * inserted at the selection location.
! */
! void replaceSelection( const std::string &text );
!
! /*! Gets the selected range.
! * \return The location range of the selection.
! * \warning Discard current selection.
! */
! SourceRange getSelectionRange() const;
! /*! Select a specified range of text.
! * Line and column are zero-based.
! * \param from Location the selection begins at.
! * \param to Location the selection ends (not included).
! */
! void setSelectionRange( const SourceRange &selection );
private:
std::string content_;
- SourceRange selection_;
};
--- 34,44 ----
const std::string getAllText() const;
! std::string getTextRange( const Refactoring::SourceRange &range );
! void replaceTextRange( const Refactoring::SourceRange &range,
! const std::string &text );
private:
std::string content_;
};
Index: TextDocument.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/TextDocument.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TextDocument.h 22 Dec 2002 16:03:50 -0000 1.3
--- TextDocument.h 16 May 2003 19:54:53 -0000 1.4
***************
*** 28,63 ****
virtual const std::string getAllText() const =0;
! /*! Gets the selected text.
! * \return Selected text. EOL are in the original text format.
! */
! virtual const std::string getSelection() const =0;
!
! /*! Replace current selection text with the specified text.
! * \param text The selection is replaced with that text. If no
! * text is selected, then the specified text is
! * inserted at the selection location.
! */
! virtual void replaceSelection( const std::string &text ) =0;
!
! /*! Gets the selected range.
! * \return The location range of the selection.
! * \warning Discard current selection.
! */
! virtual SourceRange getSelectionRange() const =0;
!
! /*! Select a specified range of text.
! * Line and column are zero-based.
! * \param from Location the selection begins at.
! * \param to Location the selection ends (not included).
*/
! virtual void setSelectionRange( const SourceRange &selection ) =0;
! /*! Move to a specific location.
! * Set the selection to an empty selection at the specified location.
! * Equivalent to selectText( to, to ).
! * \param toLocation Location the next setSelectedText() operation will insert
! * text at.
*/
! void moveTo( int toLocation );
private:
--- 28,45 ----
virtual const std::string getAllText() const =0;
! /*! Gets the text of the specified text range.
! * \param range Range of text to return.
! * \return Text of the specified text range.
*/
! virtual std::string getTextRange( const Refactoring::SourceRange &range ) = 0;
! /*! Replaces the text of a given text range with the specified text.
! * \param range Range of text to replace. Length may be null is text
! * is being inserted.
! * \param text Text that replace the specified range. May be empty if
! * the text range is being deleted.
*/
! virtual void replaceTextRange( const Refactoring::SourceRange &range,
! const std::string &text ) = 0;
private:
|