C++ Refactoring for CDT Ruby Refactoring for RDT Cute – C++ Unit Testing Easier

Overview of the helper classes

This page is automaticly generated. Do not change the content of this page!


VisibilityEnum

 Enum that represents C++ visibilities, with methods to convert to
 and from ICPPASTVisiblityLabel.


org.eclipse.cdt.internal.ui.refactoring.utils.VisibilityEnum[] values()

org.eclipse.cdt.internal.ui.refactoring.utils.VisibilityEnum valueOf(String name)

org.eclipse.cdt.internal.ui.refactoring.utils.VisibilityEnum from(ICPPASTVisibilityLabel visibility)

int getASTBaseSpecifierVisibility()

int getICPPASTVisiblityLabelVisibility()

org.eclipse.cdt.internal.ui.refactoring.utils.VisibilityEnum getEnumForStringRepresentation(String visibility)

java.lang.String toString()

TranslationUnitHelper

 A collection of methods that deal with IASTTranslationUnits.
 
 @author Mirko Stocker

 @param filename to load the translation unit from
 @return the translation unit for the file or null
IASTTranslationUnit loadTranslationUnit(String filename)
 @param tmpFile to load the translation unit from
 @return the translation unit for the file or null
IASTTranslationUnit loadTranslationUnit(IFile tmpFile)
 Visits all names in the TU to find the specified name
IASTName findNameInTranslationUnit(IASTTranslationUnit transUnit, IASTNode oldName)
 @return the first node in the translation unit or null
IASTNode getFirstNode(IASTTranslationUnit unit)

SelectionHelper

 Helper class to support operations concerning a selection.
 
 @author Mirko Stocker, Lukas Felber


Region getRegion(ISelection selection)

IASTSimpleDeclaration findFirstSelectedDeclaration(Region textSelection, IASTTranslationUnit translationUnit)

boolean isSelectionOnExpression(Region textSelection, IASTNode expression)

boolean isExpressionWhollyInSelection(Region textSelection, IASTNode expression)

boolean isInSameFile(IASTNode node, IFile file)

boolean isInSameFileSelection(Region textSelection, IASTNode node, IFile file)

boolean isSelectedFile(Region textSelection, IASTNode node, IFile file)

PseudoNameGenerator

 Helps to generate new unused names.
 
 @author Mirko Stocker


void addExistingName(String name)

java.lang.String generateNewName(String typeName)

NodeHelper

 General class for common Node operations.
 
 @author Lukas Felber & Guido Zgraggen


IASTDeclaration[] getDeclarations(IASTNode parent)

IASTNode findFollowingNode(IASTNode currentNode)

IASTNode findTopLevelParent(IASTNode currentNode)

boolean isSameNode(IASTNode node1, IASTNode node2)

IASTSimpleDeclaration findSimpleDeclarationInParents(IASTNode node)

org.eclipse.cdt.internal.ui.refactoring.MethodContext findMethodContext(IASTNode node)

IASTCompoundStatement findCompoundStatementInAncestors(IASTNode node)

IASTCompositeTypeSpecifier findClassInAncestors(IASTNode node)

IASTFunctionDefinition findFunctionDefinitionInAncestors(IASTNode node)

boolean isMethodDeclaration(IASTSimpleDeclaration simpleDeclaration)

boolean isContainedInTemplateDeclaration(IASTNode node)

NamespaceHelper

 Helper class to find Namespace informations.
 @author Mirko Stocker

 Returns the qualified name of all namespaces that are defined at the specified file and offset.
 
 @param insertFile
 @param offset
 @return ICPPASTQualifiedName with the names of all namespaces
ICPPASTQualifiedName getSurroundingNamespace(IFile insertFile, int offset)

NameHelper

 Helps with IASTNames.
 
 @author Mirko Stocker
 

boolean isValidLocalVariableName(String name)

boolean isKeyword(String name)
 Constructs the fully qualified name from the given parameters. The file and offset parameters are used to determine
 the namespace at the declaration position and the target namespace at the target position.
 
 @param declaratorName of the method or function
 @param declarationFile
 @param selectionOffset the offset in the declarationFile, usually the position or selection of the declaration
 @param insertFile the target file in which the definition is inserted
 @param insertLocation 
 @return the correct name for the target
ICPPASTQualifiedName createQualifiedNameFor(IASTName declaratorName, IFile declarationFile, int selectionOffset, IFile insertFile, int insertLocation)

java.lang.String trimFieldName(String fieldName)

java.lang.String makeFirstCharUpper(String name)

java.lang.String getTypeName(IASTParameterDeclaration parameter)

IdentifierResult

 Holds the result of a name validation, used by the IdentifierHelper.
 
 @author Thomas Corbat


boolean isCorrect()

int getResult()

java.lang.String getMessage()

IdentifierHelper

 Class to verify that an identifier meets the C++ rules for valid names.
 
 @author Thomas Corbat

 @param identifier to check
 @return an instance of IdentifierResult that holds the outcome of the validation
org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierResult checkIdentifierName(String identifier)

java.lang.String[] getKeywords()

FileHelper

 Helper class concerning files.
 
 @author Lukas Felber


IFile getIFilefromIASTNode(IASTNode node)

FileContentHelper

 Some helper methods to access part of the content of an iFile 
 
 @author Emanuel Graf


java.lang.String getContent(IFile file, int start)

java.lang.String getContent(IFile file, int start, int length)

ExpressionFinder

 @author Guido Zgraggen IFS

IASTName findExpressionInTranslationUnit(IASTTranslationUnit transUnit, IIndexName indexName)

EclipseObjects

 A collection of helper methods to interact with the 
 workbench's IDocuments and IFiles


IWorkbenchPage getActivePage()
 @return the active, visible TextEditor
IEditorPart getActiveEditor()
 Goes through all open editors to find the one with the specified file. 
 
 @param file to search for
 @return the editor or null
IEditorPart getEditorForFile(IFile file)
 @return the file from the active editor
IFile getActiveFile()
 @return the document from the currently active editor
IDocument getActiveDocument()
 @return the document opened in the editor 
IDocument getDocument(IEditorPart editor)

IWorkbenchWindow getActiveWindow()
 @return get the document that corresponds to the file
IDocument getDocument(IFile file)
 @return return the file that contains the selection or the 
 active file if there is no present selection
IFile getFile(ISelection selection)
 @return the file at the specified path string
IFile getFileForPathString(String path)
 @return the file containing the node
IFile getFile(IASTNode node)

DelayedJobRunner

 Runs a job delayed by a given time when runJob gets called. 
Only the time of the last runJob call is considered. So if runJob gets called before the time expires the first call will be ignored and the job will be run after the time of the second call + the delay time.
DelayedJobRunner isn't thread save (not neede till now).
Oh and one more thing. Do call the stop method when the runner isn't needed any more. ;-) @author Lukas Felber

void start()

void runJob()

void stop()

DefinitionFinder

 Helper class to find definitions.
 
 @author Lukas Felber


IASTName getDefinition(IASTSimpleDeclaration simpleDeclaration, IFile file)

IASTName getDefinition(IASTName methodName, IBinding bind, IFile file)

DeclarationFinderDO

 @author Guido Zgraggen IFS


DeclarationFinder

 @author Guido Zgraggen IFS

org.eclipse.cdt.internal.ui.refactoring.utils.DeclarationFinderDO getDeclaration(IASTName name, IIndex index)

IASTName findDeclarationInTranslationUnit(IASTTranslationUnit transUnit, IIndexName indexName)

CPPASTAllVisitor



int visit(IASTTranslationUnit tu)

int visit(IASTName name)

int visit(IASTDeclaration declaration)

int visit(IASTInitializer initializer)

int visit(IASTParameterDeclaration parameterDeclaration)

int visit(IASTDeclarator declarator)

int visit(IASTDeclSpecifier declSpec)

int visit(IASTExpression expression)

int visit(IASTStatement statement)

int visit(IASTTypeId typeId)

int visit(IASTEnumerator enumerator)

int visit(IASTProblem problem)

int visit(IASTComment comment)
 Visit BaseSpecifiers.
int visit(ICPPASTBaseSpecifier specifier)
 Visit namespace definitions.
int visit(ICPPASTNamespaceDefinition namespace)
 Visit template parameter.
int visit(ICPPASTTemplateParameter parameter)

int visitAll(IASTNode node)

ASTHelper



IASTNode getDeclarationForNode(IASTNode tmpNode)

IASTDeclarator getDeclaratorForNode(IASTNode aNode)

IASTDeclSpecifier getDeclarationSpecifier(IASTNode declaration)

boolean samePointers(IASTPointerOperator[] pointerOperators1, IASTPointerOperator[] pointerOperators2, TrailNodeEqualityChecker checker)

boolean isClassDeklarationName(IASTName astName)

java.util.ArrayList getNamespaces(IASTNode node)

java.util.ArrayList getNamespaces(ICPPASTQualifiedName qualifiedName)

java.util.Collection getCompositTypeSpecifiers(IASTNode baseNode)

java.util.Collection getAllInFilePreprocessorStatements(IASTTranslationUnit unit, String aktFileName)

java.util.Collection getAllInFileDeclarations(IASTTranslationUnit unit, String aktFileName)

ICPPASTUsingDirective getActiveUsingDirecitveForNode(IASTNode node, IASTTranslationUnit unit)

java.util.Collection getUsingDeclarations(IASTTranslationUnit unit)

boolean isClassDefinitionName(IASTName name)

IASTCompositeTypeSpecifier getCompositeTypeSpecifierForName(IASTName name)

java.util.Collection getFunctionDeclaratorsForClass(IASTCompositeTypeSpecifier klass)

java.util.Collection getFunctionDefinitionsForClass(IASTCompositeTypeSpecifier klass)