Class ProcessHelper
java.lang.Object
org.eclipse.cdt.core.templateengine.process.ProcessHelper
Acts as helper class for process the processes i.e., copy, replace and append files.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendFile
(String fileContents, File toFile) This method is to append the given contents into a file.static void
copyBinaryFile
(URL source, File dest) This method reads contents from source, and writes the contents into destination file.getReplaceKeys
(String str) This method returns a vector of all replace marker strings.getReplaceKeys
(String str, String startPattern, String endPattern) This method returns a vector of all replace marker strings.static String
getReplaceMarker
(String macro) static String
static String
getValueAfterExpandingMacros
(String string, Set<String> macros, Map<String, String> valueStore, String startPattern, String endPattern) static void
mkdirs
(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.resources.IFolder parentFolder) This method creates the directories in the parent folder.static String
readFromFile
(URL source) This method takes a URL as parameter to read the contents, and to add into a string buffer.
-
Field Details
-
CONDITION
- See Also:
-
START_PATTERN
- See Also:
-
END_PATTERN
- See Also:
-
EQUALS
- See Also:
-
NOT_EQUALS
- See Also:
-
-
Constructor Details
-
ProcessHelper
public ProcessHelper()
-
-
Method Details
-
appendFile
This method is to append the given contents into a file.- Parameters:
fileContents
- contents which are appended to the file.toFile
- a file to append contents.- Throws:
IOException
- exception while writing contents into a file- Since:
- 4.0
-
getReplaceKeys
This method returns a vector of all replace marker strings. (e.g., $(item), vector contains 'item' as one item) is the end pattern.- Parameters:
str
- A given string possibly containing markers.- Returns:
- the set of names occurring within markers
- Since:
- 4.0
-
getReplaceKeys
This method returns a vector of all replace marker strings. (e.g., $(item), vector contains 'item' as one item) is the end pattern.- Parameters:
str
- A given string possibly containing markers.startPattern
- token to start macro replacementendPattern
- token to end macro replacement- Returns:
- the set of names occurring within markers
- Since:
- 5.5
-
readFromFile
This method takes a URL as parameter to read the contents, and to add into a string buffer.- Parameters:
source
- URL to read the contents.- Returns:
- string contents of a file specified in the URL source path.
- Throws:
IOException
- Since:
- 4.0
-
copyBinaryFile
This method reads contents from source, and writes the contents into destination file.- Parameters:
source
- URL to read the contents.dest
- destination file to write the contents.- Throws:
IOException
- Since:
- 4.0
-
mkdirs
public static void mkdirs(org.eclipse.core.resources.IProject projectHandle, org.eclipse.core.resources.IFolder parentFolder) throws org.eclipse.core.runtime.CoreException This method creates the directories in the parent folder.- Parameters:
projectHandle
-parentFolder
-- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getValueAfterExpandingMacros
public static String getValueAfterExpandingMacros(String string, Set<String> macros, Map<String, String> valueStore) - Parameters:
string
-macros
-valueStore
-- Returns:
- the macro value after expanding the macros.
- Since:
- 4.0
-
getValueAfterExpandingMacros
public static String getValueAfterExpandingMacros(String string, Set<String> macros, Map<String, String> valueStore, String startPattern, String endPattern) - Parameters:
string
-macros
-valueStore
-- Returns:
- the macro value after expanding the macros.
- Since:
- 5.5
-
getReplaceMarker
- Parameters:
macro
-- Returns:
- the replacement marker string
- Since:
- 4.0
-