Package org.eclipse.cdt.core.cdtvariables

# Interface ICdtVariableManager

public interface ICdtVariableManager

Since:
  3.0
Restriction:
  This interface is not intended to be implemented by clients.
Restriction:
  This interface is not intended to be extended by clients.

## Method Summary

Modifier and Type
Method
Description
`void`
`checkVariableIntegrity(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.
`String`
`convertStringListToString(String[] value, String listDelimiter)`
converts StringList value into String of the following format: "<value_1>< listDelimiter ><value_2>< listDelimiter > ...
`ICdtVariable`
`getVariable(String name, 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(ICConfigurationDescription cfg)`
`boolean`
`isEnvironmentVariable(ICdtVariable variable, ICConfigurationDescription cfg)`
`boolean`
`isStringListValue(String value, ICConfigurationDescription cfg)`
`boolean`
`isUserVariable(ICdtVariable variable, ICConfigurationDescription cfg)`
`String[]`
`resolveStringListValue(String value, String nonexistentMacrosValue, String listDelimiter, 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
`String[]`
`resolveStringListValues(String[] value, String nonexistentMacrosValue, String listDelimiter, ICConfigurationDescription cfg)`
resolves macros in the array of string-list values
`String`
`resolveValue(String value, String nonexistentMacrosValue, String listDelimiter, ICConfigurationDescription cfg)`
resolves all macros in the string.
`org.eclipse.core.variables.IStringVariable`
`toEclipseVariable(ICdtVariable variable, ICConfigurationDescription cfg)`

## Method Details

### getVariable

ICdtVariable getVariable(String name, 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:
  `name` - macro name

### getVariables

ICdtVariable[] getVariables(ICConfigurationDescription cfg)

Returns:
  the array of the IBuildMacro representing all available macros

### convertStringListToString

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

### resolveValue

String resolveValue(String value, String nonexistentMacrosValue, String listDelimiter, 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 "<value_1>< listDelimiter ><value_2>< listDelimiter > ... <value_n>" otherwise the BuildMacroException is thrown in case the string to be resolved references string-list macros
Throws:
  `CdtVariableException`

### resolveStringListValue

String[] resolveStringListValue(String value, String nonexistentMacrosValue, String listDelimiter, 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`

### resolveStringListValues

String[] resolveStringListValues(String[] value, String nonexistentMacrosValue, String listDelimiter, ICConfigurationDescription cfg) throws CdtVariableException
resolves macros in the array of string-list values

Throws:
  `CdtVariableException`
See Also:
  - `isStringListValue(java.lang.String, org.eclipse.cdt.core.settings.model.ICConfigurationDescription)`

### isStringListValue

boolean isStringListValue(String value, ICConfigurationDescription cfg) throws CdtVariableException

Returns:
  true if the specified expression can be treated as StringList 1. The string value is "${<some_StringList_Macro_name>}"
Throws:
  `CdtVariableException`

### checkVariableIntegrity

void checkVariableIntegrity(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, ICConfigurationDescription cfg)

### isUserVariable

boolean isUserVariable(ICdtVariable variable, ICConfigurationDescription cfg)

### toEclipseVariable

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