private EclipseVarMacro(IStringVariable var, String argument) { fVariable = var; fType = VALUE_TEXT; fName = var.getName(); if (argument != null) fName += COLON + argument; fArgument = argument; }
/* (non-Javadoc) * @see org.eclipse.cdt.managedbuilder.macros.IBuildMacro#getStringValue() */ @Override public String getStringValue() throws CdtVariableException { if (!fInitialized) { try { if (!canExpandVariable(fVariable.getName(), fArgument)) { final String expression = "${" + fName + "}"; // $NON-NLS-1$//$NON-NLS-2$ throw new CdtVariableException( ICdtVariableStatus.TYPE_MACRO_REFERENCE_INCORRECT, NLS.bind(Messages.EclipseVariablesVariableSupplier_illegal_variable, expression), null, fVariable.getName(), expression, null); } loadValue(fVariable); } finally { fInitialized = true; } } return fStringValue; }