Namespace: Consultingwerk.Studio.Refactor
Class 
RenameMove Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:RenameMove
Purpose:Provides methods to rename or move a class
Author(s):Sebastian Wandel / Consultingwerk Ltd.
Created:Thu Jun 17 09:06:16 CEST 2021



Top Method Summary
Options Name Purpose
# AddUsingStatement (ClassName, INode) Adds a USING statement to a given classes package
+ MoveClass (character, character) Moves a class
+ MoveClass (character, character, character, character) Moves a class from one package to another
+ MoveClass (character, character, character, character, handle) Moves a class from one package to another, replaces include file references
+ MoveClass (character, character, character, character, logical) Moves a class from one package to another
# RenameAllStaticReferences (ClassName, ClassName, INode) Renames all static references to a given class name
+ RenameClass (character, character) Renames a class
# RenameConstructor (ClassName, INode) Renames constructors
# RenameDestructor (ClassName, INode) Renames destructors
# RenameFullStaticReferences (ClassName, ClassName, INode) Renames all full static references to a given class name
+ ReplaceIncludeFileArguments (character, character, character) Replaces an argument passed to an include file
+ ReplaceIncludeFileReferences (character, character, character) Replaces references to an include file
+ ReplaceIncludeFileReferences (character, handle) Replaces references to multiple include file references
+ ReplaceStringLiterals (character, character, character) Replaces String literals in a file
+ ReplaceStringLiterals (character, character, character, logical) Replaces String literals in a file
# UpdateClassStatement (ClassName, INode) Sets the class name in the CLASS statement


Method Detail
Top

PROTECTED AddUsingStatement (ClassName, INode)

Purpose: Adds a USING statement to a given classes package
Notes:

Parameters:
poNewClassName Consultingwerk.ClassName
The class to add a USING for
poNode Consultingwerk.Studio.ProparseApi.INode
The root-node
Top

PUBLIC MoveClass (character, character)

Purpose: Moves a class
Notes:

Parameters:
pcOldPath CHARACTER
The current path to the class-file
pcNewPath CHARACTER
The new path to to class-file
Top

PUBLIC MoveClass (character, character, character, character)

Purpose: Moves a class from one package to another
Notes:

Parameters:
pcPattern CHARACTER
Pattern for substitution &1 for package, &2 for class name
pcFilename CHARACTER
The class-name part of the class to move
pcOldPackage CHARACTER
The old (current) package of the file
pcNewPackage CHARACTER
The new package of the file
Top

PUBLIC MoveClass (character, character, character, character, handle)

Purpose: Moves a class from one package to another, replaces include file references
Notes:

Parameters:
pcPattern CHARACTER
Pattern for substitution &1 for package, &2 for class name
pcFilename CHARACTER
The class-name part of the class to move
pcOldPackage CHARACTER
The old (current) package of the file
pcNewPackage CHARACTER
The new package of the file
phFileMovement HANDLE
Table-handle for include file references to replace
Top

PUBLIC MoveClass (character, character, character, character, logical)

Purpose: Moves a class from one package to another
Notes:

Parameters:
pcPattern CHARACTER
Pattern for substitution &1 for package, &2 for class name
pcFilename CHARACTER
The class-name part of the class to move
pcOldPackage CHARACTER
The old (current) package of the file
pcNewPackage CHARACTER
The new package of the file
plThrowError LOGICAL
Whether to throw an error if the file doesn't exist
Top

PROTECTED RenameAllStaticReferences (ClassName, ClassName, INode)

Purpose: Renames all static references to a given class name
Notes:

Parameters:
poOldClassName Consultingwerk.ClassName
The old ClassName
poNewClassName Consultingwerk.ClassName
The new ClassName
poNode Consultingwerk.Studio.ProparseApi.INode
The current node
Top

PUBLIC RenameClass (character, character)

Purpose: Renames a class
Notes: Renames the .cls file and updates the source code

Parameters:
pcFilePath CHARACTER
The path to the class-file
pcNewName CHARACTER
The classes new name
Top

PROTECTED RenameConstructor (ClassName, INode)

Purpose: Renames constructors
Notes:

Parameters:
poNewClassName Consultingwerk.ClassName
The new ClassName
poNode Consultingwerk.Studio.ProparseApi.INode
The root-node
Top

PROTECTED RenameDestructor (ClassName, INode)

Purpose: Renames destructors
Notes:

Parameters:
poNewClassName Consultingwerk.ClassName
The new ClassName
poNode Consultingwerk.Studio.ProparseApi.INode
The root-node
Top

PROTECTED RenameFullStaticReferences (ClassName, ClassName, INode)

Purpose: Renames all full static references to a given class name
Notes:

Parameters:
poOldClassName Consultingwerk.ClassName
The old ClassName
poNewClassName Consultingwerk.ClassName
The new ClassName
poNode Consultingwerk.Studio.ProparseApi.INode
The current node
Top

PUBLIC ReplaceIncludeFileArguments (character, character, character)

Purpose: Replaces an argument passed to an include file
Notes:

Parameters:
pcFilename CHARACTER
The file to replace in
pcOldArgument CHARACTER
The old argument
pcNewArgument CHARACTER
The new argument
Top

PUBLIC ReplaceIncludeFileReferences (character, character, character)

Purpose: Replaces references to an include file
Notes:

Parameters:
pcFilename CHARACTER
The file to replace references in
pcOldIncludeFilename CHARACTER
The old include file reference
pcNewIncludeFilename CHARACTER
The new include file reference
Top

PUBLIC ReplaceIncludeFileReferences (character, handle)

Purpose: Replaces references to multiple include file references
Notes:

Parameters:
pcFilename CHARACTER
The file to replace references in
phFileMovement HANDLE
The handle of the temp-table with moved files
Top

PUBLIC ReplaceStringLiterals (character, character, character)

Purpose: Replaces String literals in a file
Notes: Checks for both single and double quoted Strings

Parameters:
pcFilename CHARACTER
The file to make replacements in
pcOldString CHARACTER
The old unquoted String
pcNewString CHARACTER
The new unquoted String
Top

PUBLIC ReplaceStringLiterals (character, character, character, logical)

Purpose: Replaces String literals in a file
Notes: Checks for both single and double quoted Strings

Parameters:
pcFilename CHARACTER
The file to make replacements in
pcOldString CHARACTER
The old unquoted String
pcNewString CHARACTER
The new unquoted String
plFileAssert LOGICAL
Whether an exception should be thrown if the file doesn't exist
Top

PROTECTED UpdateClassStatement (ClassName, INode)

Purpose: Sets the class name in the CLASS statement
Notes:

Parameters:
poNewClassName Consultingwerk.ClassName
The new ClassName
poNode Consultingwerk.Studio.ProparseApi.INode
The root-node


©2006-2023 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       08.12.2024 13:23:17