2 * Copyright (c) 2000-2004 by JetBrains s.r.o. All Rights Reserved.
3 * Use is subject to license terms.
5 package com
.intellij
.openapi
.components
;
7 import com
.intellij
.openapi
.util
.text
.StringUtil
;
12 * @author Eugene Zhuravlev
15 public class ExpandMacroToPathMap
extends PathMacroMap
{
17 public void addMacroExpand(String macroName
, String path
) {
18 put("$" + macroName
+ "$", quotePath(path
));
21 public String
substitute(String text
, boolean caseSensitive
) {
22 for (Map
.Entry
<String
, String
> entry
: entries()) {
23 // when replacing macros with actual paths the replace utility may be used as always 'case-sensitive'
24 // for case-insensitive file systems there will be no unnecesary toLowerCase() transforms.
25 text
= StringUtil
.replace(text
, entry
.getKey(), entry
.getValue(), false);