public class CdtVariableResolver extends Object
IVariableSubstitutor
.Modifier and Type | Field and Description |
---|---|
static String |
VAR_ARCH_TYPE |
static String |
VAR_CDT_VERSION |
static String |
VAR_CONFIG_DESCRIPTION |
static String |
VAR_CONFIG_NAME |
static String |
VAR_DIRECTORY_DELIMITER |
static String |
VAR_ECLIPSE_VERSION |
static String |
VAR_HOST_ARCH_NAME |
static String |
VAR_HOST_OS_NAME |
static String |
VAR_OS_TYPE |
static String |
VAR_PATH_DELIMITER |
static String |
VAR_PROJ_DIR_PATH |
static String |
VAR_PROJ_NAME |
static String |
VAR_WORKSPACE_DIR_PATH |
static char |
VARIABLE_ESCAPE_CHAR |
static String |
VARIABLE_PREFIX |
static char |
VARIABLE_SUFFIX |
Constructor and Description |
---|
CdtVariableResolver() |
Modifier and Type | Method and Description |
---|---|
static void |
checkIntegrity(IVariableContextInfo info,
IVariableSubstitutor substitutor)
Checks the macros integrity for the given context.
|
static void |
checkVariables(String string,
IVariableSubstitutor substitutor)
Deprecated.
Use
resolveToString(java.lang.String, org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor) which would do full nested expansion. |
static String |
convertStringListToString(String[] value,
String listDelimiter)
Converts list of strings to one string using given string as delimiter,
i.e -> "string1:string2:string3"
|
static String |
createVariableReference(String name)
Constructs a macro reference given the macro name
e.g.
|
static boolean |
isStringListVariable(int macroType)
Test for String-list type of macro.
|
static String[] |
resolveStringListValues(String[] values,
IVariableSubstitutor substitutor,
boolean ignoreErrors)
Resolves array of macros using
substitutor to pull macro's list of values. |
static String |
resolveToString(String string,
IVariableSubstitutor substitutor)
Resolves macros of kind ${Macro} in the given string by calling the macro substitutor
for each macro reference found.
|
static String[] |
resolveToStringList(String string,
IVariableSubstitutor substitutor)
Resolves macro ${ListMacro} in the given String to the String-list using substitutor
to pull macro's list of values.
|
public static final String VAR_CONFIG_NAME
public static final String VAR_CONFIG_DESCRIPTION
public static final String VAR_PROJ_NAME
public static final String VAR_PROJ_DIR_PATH
public static final String VAR_WORKSPACE_DIR_PATH
public static final String VAR_DIRECTORY_DELIMITER
public static final String VAR_PATH_DELIMITER
public static final String VAR_ECLIPSE_VERSION
public static final String VAR_CDT_VERSION
public static final String VAR_HOST_OS_NAME
public static final String VAR_HOST_ARCH_NAME
public static final String VAR_OS_TYPE
public static final String VAR_ARCH_TYPE
public static final String VARIABLE_PREFIX
public static final char VARIABLE_SUFFIX
public static final char VARIABLE_ESCAPE_CHAR
public static String convertStringListToString(String[] value, String listDelimiter)
value
- - list of strings to convert.listDelimiter
- - delimiter.public static String resolveToString(String string, IVariableSubstitutor substitutor) throws CdtVariableException
string
- - macro expression.substitutor
- - macro resolution provider to retrieve macro values.CdtVariableException
- if substitutor can't handle the macro and returns null or throws.@Deprecated public static void checkVariables(String string, IVariableSubstitutor substitutor) throws CdtVariableException
resolveToString(java.lang.String, org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor)
which would do full nested expansion.string
- substitutor
- CdtVariableException
public static String[] resolveStringListValues(String[] values, IVariableSubstitutor substitutor, boolean ignoreErrors) throws CdtVariableException
substitutor
to pull macro's list of values.
Note that each macro of input array can in turn provide list of values and
the resulting array combines all of them.values
- - input array of macros.substitutor
- - macro resolution provider to retrieve macro values.ignoreErrors
- - if true
then exceptions are caught and ignored.CdtVariableException
- if substitutor throws CdtVariableException
and ignoreErrors
=null
.public static String[] resolveToStringList(String string, IVariableSubstitutor substitutor) throws CdtVariableException
string
- - input string.substitutor
- - macro resolution provider to retrieve macro values.CdtVariableException
- if substitutor can't handle the macro and returns null or throws.public static boolean isStringListVariable(int macroType)
macroType
- - type of tested macro.true
if the given macro is a String-list macro.public static void checkIntegrity(IVariableContextInfo info, IVariableSubstitutor substitutor) throws CdtVariableException
CdtVariableException
is thrown.info
- - context information to acquire list of available macros.substitutor
- - macro resolution provider to retrieve macro values.CdtVariableException
- propagated up if substitutor
throws.Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.