org.eclipse.cdt.core.cdtvariables
Interface ICdtVariableManager

All Known Implementing Classes:
CdtVariableManager

public interface ICdtVariableManager

Since:
3.0

Method Summary
 void checkVariableIntegrity(org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
          checks the integrity of the Macros If there are inconsistencies, such as when a macro value refers to a nonexistent macro or when two macros refer to each other, this method will throw the BuildMacroException exception The BuildMacroException will contain the human-readable string describing the inconsistency and the array of the IBuildMacro interfaces that will represent the macros that caused the inconsistency.
 java.lang.String convertStringListToString(java.lang.String[] value, java.lang.String listDelimiter)
          converts StringList value into String of the following format: "< listDelimiter >< listDelimiter > ...
 ICdtVariable getVariable(java.lang.String name, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
          Returns reference to the IBuildMacro interface representing Macro of the specified name or null if there is there is no such macro
 ICdtVariable[] getVariables(org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
           
 boolean isEnvironmentVariable(ICdtVariable variable, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
           
 boolean isStringListValue(java.lang.String value, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
           
 boolean isUserVariable(ICdtVariable variable, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
           
 java.lang.String[] resolveStringListValue(java.lang.String value, java.lang.String nonexistentMacrosValue, java.lang.String listDelimiter, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
          if the string contains a value that can be treated as a StringList resolves it to arrays of strings otherwise throws the BuildMacroException exception
 java.lang.String[] resolveStringListValues(java.lang.String[] value, java.lang.String nonexistentMacrosValue, java.lang.String listDelimiter, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
          resolves macros in the array of string-list values
 java.lang.String resolveValue(java.lang.String value, java.lang.String nonexistentMacrosValue, java.lang.String listDelimiter, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
          resolves all macros in the string.
 org.eclipse.core.variables.IStringVariable toEclipseVariable(ICdtVariable variable, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
           
 

Method Detail

getVariable

ICdtVariable getVariable(java.lang.String name,
                         org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
Returns reference to the IBuildMacro interface representing Macro of the specified name or null if there is there is no such macro

Parameters:
macroName - macro name
contextType - represents the context type. Should be set to one of the the IBuildMacroProvider. CONTEXT_xxx constants
contextData - represents the additional data needed by the Build Macro Provider and Macro Suppliers in order to obtain the macro value. The type of the context data differs depending on the context type and can be one of the following: 1. IFileContextData interface � used to represent currently selected file context the IFileContextData interface is defined as follows: pulic interface IFileContextData{ IFile getFile(); IOption getOption(); } NOTE: the IFileContextData is passed that represents the current file and the option for that file because Macro Value Provider needs to know what option should be used as a context in case macro is not found for �current file� context 2. IOptionContextData interface used to represent the currently selected option context 3. IConfiguration � used to represent the currently selected configuration context 4. IProject � used to represent current project context 5. IWorkspace � used to represent current workspace context 6. null � to represent the CDT and Eclipse installation context 7. null � to represent process environment context
includeParentContext - specifies whether lower-precedence context macros should be included

getVariables

ICdtVariable[] getVariables(org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
Returns:
the array of the IBuildMacro representing all available macros

convertStringListToString

java.lang.String convertStringListToString(java.lang.String[] value,
                                           java.lang.String listDelimiter)
converts StringList value into String of the following format: "< listDelimiter >< listDelimiter > ... "


resolveValue

java.lang.String resolveValue(java.lang.String value,
                              java.lang.String nonexistentMacrosValue,
                              java.lang.String listDelimiter,
                              org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
                              throws CdtVariableException
resolves all macros in the string.

Parameters:
value - the value to be resolved
nonexistentMacrosValue - specifies the value that inexistent macro references will be expanded to. If null the BuildMacroException is thrown in case the string to be resolved references inexistent macros
listDelimiter - if not null, StringList macros are expanded as �< listDelimiter >< listDelimiter > ... � otherwise the BuildMacroException is thrown in case the string to be resolved references string-list macros
contextType - context from which the macro search should be started
contextData - context data
Throws:
CdtVariableException

resolveStringListValue

java.lang.String[] resolveStringListValue(java.lang.String value,
                                          java.lang.String nonexistentMacrosValue,
                                          java.lang.String listDelimiter,
                                          org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
                                          throws CdtVariableException
if the string contains a value that can be treated as a StringList resolves it to arrays of strings otherwise throws the BuildMacroException exception

Throws:
CdtVariableException
See Also:
isStringListValue

resolveStringListValues

java.lang.String[] resolveStringListValues(java.lang.String[] value,
                                           java.lang.String nonexistentMacrosValue,
                                           java.lang.String listDelimiter,
                                           org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
                                           throws CdtVariableException
resolves macros in the array of string-list values

Throws:
CdtVariableException
See Also:
isStringListValue

isStringListValue

boolean isStringListValue(java.lang.String value,
                          org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
                          throws CdtVariableException
Returns:
true if the specified expression can be treated as StringList 1. The string value is �${}�
Throws:
CdtVariableException

checkVariableIntegrity

void checkVariableIntegrity(org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)
                            throws CdtVariableException
checks the integrity of the Macros If there are inconsistencies, such as when a macro value refers to a nonexistent macro or when two macros refer to each other, this method will throw the BuildMacroException exception The BuildMacroException will contain the human-readable string describing the inconsistency and the array of the IBuildMacro interfaces that will represent the macros that caused the inconsistency. This information will be used in the UI to notify the user about the macro inconsistencies (see also the �User interface for viewing and editing Build Macros� section of this design)

Throws:
CdtVariableException

isEnvironmentVariable

boolean isEnvironmentVariable(ICdtVariable variable,
                              org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)

isUserVariable

boolean isUserVariable(ICdtVariable variable,
                       org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)

toEclipseVariable

org.eclipse.core.variables.IStringVariable toEclipseVariable(ICdtVariable variable,
                                                             org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfg)