57 references to EscapingUtilities
Microsoft.Build.Utilities.Core (15)
FileUtilities.cs (2)
759fileSpec = FixFilePath(EscapingUtilities.UnescapeAll(fileSpec)); 762string fullPath = EscapingUtilities.Escape(NormalizePath(Path.Combine(currentDirectory, fileSpec)));
Modifiers.cs (3)
508string unescapedItemSpec = EscapingUtilities.UnescapeAll(itemSpec); 526string unescapedItemSpec = EscapingUtilities.UnescapeAll(itemSpec); 542string unescapedItemSpec = EscapingUtilities.UnescapeAll(itemSpec);
TaskItem.cs (10)
132_itemSpec = EscapingUtilities.Escape(sourceItem.ItemSpec); 133_definingProject = EscapingUtilities.EscapeWithCaching(sourceItem.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath)); 159get => _itemSpec == null ? string.Empty : EscapingUtilities.UnescapeAll(_itemSpec); 289return EscapingUtilities.UnescapeAll(metadataValue); 349destinationItem.SetMetadata(entry.Key, EscapingUtilities.Escape(entry.Value)); 364destinationItem.SetMetadata("OriginalItemSpec", EscapingUtilities.Escape(ItemSpec)); 389dictionary.Add(entry.Key, EscapingUtilities.UnescapeAll(entry.Value)); 459void ITaskItem2.SetMetadataValueLiteral(string metadataName, string metadataValue) => SetMetadata(metadataName, EscapingUtilities.Escape(metadataValue)); 506var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value)); 522var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value));
Microsoft.Build.Utilities.UnitTests (42)
EscapingUtilities_Tests.cs (42)
18Assert.Equal("", EscapingUtilities.UnescapeAll("")); 19Assert.Equal("foo", EscapingUtilities.UnescapeAll("foo")); 20Assert.Equal("foo space", EscapingUtilities.UnescapeAll("foo%20space")); 21Assert.Equal("foo2;", EscapingUtilities.UnescapeAll("foo2%3B")); 22Assert.Equal(";foo3", EscapingUtilities.UnescapeAll("%3bfoo3")); 23Assert.Equal(";", EscapingUtilities.UnescapeAll("%3b")); 24Assert.Equal(";;;;;", EscapingUtilities.UnescapeAll("%3b%3B;%3b%3B")); 25Assert.Equal("%3B", EscapingUtilities.UnescapeAll("%253B")); 26Assert.Equal("===%ZZ %%%===", EscapingUtilities.UnescapeAll("===%ZZ%20%%%===")); 27Assert.Equal("hello; escaping% how( are) you?", EscapingUtilities.UnescapeAll("hello%3B escaping%25 how%28 are%29 you%3f")); 29Assert.Equal("%*?*%*", EscapingUtilities.UnescapeAll("%25*?*%25*")); 30Assert.Equal("%*?*%*", EscapingUtilities.UnescapeAll("%25%2a%3f%2a%25%2a")); 32Assert.Equal("*Star*craft or *War*cr@ft??", EscapingUtilities.UnescapeAll("%2aStar%2Acraft%20or %2aWar%2Acr%40ft%3f%3F")); 40Assert.Equal("%2a", EscapingUtilities.Escape("*")); 41Assert.Equal("%3f", EscapingUtilities.Escape("?")); 42Assert.Equal("#%2a%3f%2a#%2a", EscapingUtilities.Escape("#*?*#*")); 43Assert.Equal("%25%2a%3f%2a%25%2a", EscapingUtilities.Escape("%*?*%*")); 52Assert.Equal(text, EscapingUtilities.UnescapeAll(EscapingUtilities.Escape(text))); 55Assert.Equal(text, EscapingUtilities.UnescapeAll(EscapingUtilities.Escape(text))); 58Assert.Equal(text, EscapingUtilities.UnescapeAll(EscapingUtilities.Escape(text))); 67Assert.Equal(text, EscapingUtilities.Escape(EscapingUtilities.UnescapeAll(text))); 70Assert.Equal(text, EscapingUtilities.Escape(EscapingUtilities.UnescapeAll(text))); 73Assert.Equal(text, EscapingUtilities.Escape(EscapingUtilities.UnescapeAll(text))); 79Assert.False(EscapingUtilities.ContainsEscapedWildcards("NoStarOrQMark")); 80Assert.False(EscapingUtilities.ContainsEscapedWildcards("%")); 81Assert.False(EscapingUtilities.ContainsEscapedWildcards("%%")); 82Assert.False(EscapingUtilities.ContainsEscapedWildcards("%2")); 83Assert.False(EscapingUtilities.ContainsEscapedWildcards("%4")); 84Assert.False(EscapingUtilities.ContainsEscapedWildcards("%3A")); 85Assert.False(EscapingUtilities.ContainsEscapedWildcards("%2B")); 86Assert.True(EscapingUtilities.ContainsEscapedWildcards("%2a")); 87Assert.True(EscapingUtilities.ContainsEscapedWildcards("%2A")); 88Assert.True(EscapingUtilities.ContainsEscapedWildcards("%3F")); 89Assert.True(EscapingUtilities.ContainsEscapedWildcards("%3f")); 90Assert.True(EscapingUtilities.ContainsEscapedWildcards("%%3f")); 91Assert.True(EscapingUtilities.ContainsEscapedWildcards("%3%3f"));