From: Baptiste L. <gai...@fr...> - 2003-05-15 19:01:12
|
----- Original Message ----- From: "Andre Baresel" <and...@gm...> To: "CppTool Mailing List" <Cpp...@li...> Sent: Thursday, May 15, 2003 6:02 PM Subject: Re: [Cpptool-develop] TextDocument interface change... > Baptiste Lepilleur wrote: > > > There is a lot of stuff we don't need there. The only need for > > refactoring are: > > > >// retrieve all the text > > const std::string getAllText() const; > >// retrieve a specified text range > > > > std::string getTextRange( const Refactoring::SourceRange &range ); > > > >// replace a specified text range > > > > void replaceTextRange( const Refactoring::SourceRange &range, > > const std::string &text ); > > > > > > This make the interface simpler and less ambiguous. With this interface, > >there is no 'state'. It is simpler to implement and less ambigous. > > > > Does anybody have suggestion to further improve the interface ? > > > well don't forget the method > > // get an area/position selected by the user: > virtual SourceRange getSelectionRange() const =0; > > since we need to know what text area is currently selected within a IDE. Actually it's not needed by the refactoring engine since the active selection range is passed to the constructor. Though, this method is probably common to all add-ins. Baptiste. > > -- André |