|
Carbide.c++ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMakefileViewBase
This is the interface to reading and modifying the Makefile contents.
This is radically simplified and stupid. CDT's IMakefile doesn't provide write access, so instead of implementing a parallel layer, we expose only operations that query the model or make simple text-based operations. Changes are made to the backing text and the model is reparsed. Obviously, this is meant only for occasional operations.
Method Summary | |
---|---|
void |
appendText(java.lang.String text)
Append new text to the file. |
void |
deleteDirective(IDirective directive)
Delete a directive and any children. |
java.lang.String |
expandAllMacrosInRuleString(java.lang.String target,
ITargetRule rule)
Expand macro definition references in string. |
java.lang.String |
expandAllMacrosInString(java.lang.String text)
Expand macro definition references in string. |
ICommand[] |
findCommandsInvoking(java.lang.String program)
Get commands in any rule that run this program (either literal filename or $(var)) |
ITargetRule |
findRuleForTarget(java.lang.String target,
boolean exactMatch)
Get (last) rule with the given target |
IMacroDefinition[] |
getAllMacroDefinitions()
Find all the macro definitions, recursively. |
IMacroDefinition[] |
getAllMacroDefinitions(java.lang.String name)
Find all the macro definitions for the given name, recursively. |
java.lang.String |
getEOL()
Get end-of-line terminator used in the makefile. |
IMakefile |
getMakefile()
Get CDT representation of makefile, with read-only access. |
void |
insertText(IDirective directive,
java.lang.String text)
Insert a new line after the given directive. |
void |
insertTextBefore(java.lang.String text,
IDirective directive)
Insert a new line before the given directive. |
void |
replaceDirective(IDirective directive,
java.lang.String text)
Replace a directive with alternate text. |
java.lang.String |
unexpandMacros(java.lang.String text,
boolean exhaustive)
Try to replace literal text in the given string with macros. |
java.lang.String |
unexpandMacros(java.lang.String text,
java.lang.String[] macroNames)
Try to replace literal text in the given string with the given macros. |
Method Detail |
---|
IMakefile getMakefile()
IMacroDefinition[] getAllMacroDefinitions()
IMacroDefinition[] getAllMacroDefinitions(java.lang.String name)
java.lang.String expandAllMacrosInString(java.lang.String text)
text
-
java.lang.String expandAllMacrosInRuleString(java.lang.String target, ITargetRule rule)
target
- rule
-
java.lang.String unexpandMacros(java.lang.String text, boolean exhaustive)
If exhaustive is true, then conditionalized macros in the Makefile are replaced too.
ITargetRule findRuleForTarget(java.lang.String target, boolean exactMatch)
target
- filename or filepathexactMatch
- if true, verify same filepath; else, just check filename
ICommand[] findCommandsInvoking(java.lang.String program)
program
-
java.lang.String getEOL()
void appendText(java.lang.String text)
Note: this invalidates any directives read from the model.
text
- text to add (add #getEOL() if a full line)void insertText(IDirective directive, java.lang.String text)
Note: this invalidates any directives read from the model.
directive
- directive, or null for start of filetext
- text to add (add #getEOL() if a full line)void insertTextBefore(java.lang.String text, IDirective directive)
Note: this invalidates any directives read from the model.
text
- text to add (add #getEOL() if a full line)directive
- directive, or null for end of filevoid deleteDirective(IDirective directive)
Note: this invalidates any directives read from the model. directives read from the model.
void replaceDirective(IDirective directive, java.lang.String text)
Note: this invalidates any directives read from the model.
java.lang.String unexpandMacros(java.lang.String text, java.lang.String[] macroNames)
|
Carbide.c++ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |