78 references to QuotingUtilities
Microsoft.Build.CommandLine.UnitTests (60)
XMake_Tests.cs (60)
165var sa = QuotingUtilities.SplitUnquoted("abcdxyz"); 170sa = QuotingUtilities.SplitUnquoted("abcc dxyz"); 176sa = QuotingUtilities.SplitUnquoted("abcc;dxyz", ';'); 182sa = QuotingUtilities.SplitUnquoted("abc,c;dxyz", ';', ','); 189sa = QuotingUtilities.SplitUnquoted("abc,c;dxyz", 2, false, false, out var emptySplits, ';', ','); 196sa = QuotingUtilities.SplitUnquoted("abc,,;dxyz", int.MaxValue, false, false, out emptySplits, ';', ','); 203sa = QuotingUtilities.SplitUnquoted("abc,,;dxyz", int.MaxValue, true, false, out emptySplits, ';', ','); 212sa = QuotingUtilities.SplitUnquoted("abc\"c d\"xyz"); 217sa = QuotingUtilities.SplitUnquoted("abc\"x z"); 222sa = QuotingUtilities.SplitUnquoted("abc\"x z\""); 227sa = QuotingUtilities.SplitUnquoted("abc\\\"cde\"x z"); 233sa = QuotingUtilities.SplitUnquoted("abc\\\"c e\"x z"); 239sa = QuotingUtilities.SplitUnquoted("abc\\\\\"c e\"xyz"); 245sa = QuotingUtilities.SplitUnquoted("abc\\\\\"c e\"x z"); 251sa = QuotingUtilities.SplitUnquoted("abc\\\\\\\"cde\"x z"); 257sa = QuotingUtilities.SplitUnquoted("abc\\\\\\\"c e\"x z"); 263sa = QuotingUtilities.SplitUnquoted("abc\"\"\"xyz"); 268sa = QuotingUtilities.SplitUnquoted("abc\" \"\"xyz"); 273sa = QuotingUtilities.SplitUnquoted("abc\"\" \"x z"); 279sa = QuotingUtilities.SplitUnquoted("abc\" \"\"\"x z"); 284sa = QuotingUtilities.SplitUnquoted("abc\"\"\"\"\"xyz"); 290sa = QuotingUtilities.SplitUnquoted("abc\"\"\"\"\"x z"); 296sa = QuotingUtilities.SplitUnquoted("abc\" \"\"\"\"xyz"); 301sa = QuotingUtilities.SplitUnquoted("abc\"\"\"\"\"\"xyz"); 306sa = QuotingUtilities.SplitUnquoted("abc\" \"\"\" \"\"xyz"); 311sa = QuotingUtilities.SplitUnquoted("abc\"\"\" \"\"\"xyz"); 317sa = QuotingUtilities.SplitUnquoted("abc\"\"\" \"\"\"x z"); 324sa = QuotingUtilities.SplitUnquoted("abc\"c e\"\"xyz"); 330sa = QuotingUtilities.SplitUnquoted("abc\"c e\"\"x z"); 336sa = QuotingUtilities.SplitUnquoted("a c\"\"x z"); 343sa = QuotingUtilities.SplitUnquoted("a c\"\"c e\"\"x z"); 355QuotingUtilities.Unquote("abc\"cde\"xyz", out var doubleQuotesRemoved).ShouldBe("abccdexyz"); 359QuotingUtilities.Unquote("abc\"xyz", out doubleQuotesRemoved).ShouldBe("abcxyz"); 363QuotingUtilities.Unquote("abc\"xyz\"", out doubleQuotesRemoved).ShouldBe("abcxyz"); 367QuotingUtilities.Unquote("abc\\\"cde\"xyz", out doubleQuotesRemoved).ShouldBe("abc\"cdexyz"); 371QuotingUtilities.Unquote("abc\\\\\"cde\"xyz", out doubleQuotesRemoved).ShouldBe("abc\\cdexyz"); 375QuotingUtilities.Unquote("abc\\\\\\\"cde\"xyz", out doubleQuotesRemoved).ShouldBe("abc\\\"cdexyz"); 379QuotingUtilities.Unquote("abc\"\"\"xyz", out doubleQuotesRemoved).ShouldBe("abc\"xyz"); 383QuotingUtilities.Unquote("abc\"\"\"\"xyz", out doubleQuotesRemoved).ShouldBe("abc\"xyz"); 387QuotingUtilities.Unquote("abc\"\"\"\"\"xyz", out doubleQuotesRemoved).ShouldBe("abc\"xyz"); 391QuotingUtilities.Unquote("abc\"\"\"\"\"\"xyz", out doubleQuotesRemoved).ShouldBe("abc\"\"xyz"); 395QuotingUtilities.Unquote("abc\"cde\"\"xyz", out doubleQuotesRemoved).ShouldBe("abccde\"xyz"); 399QuotingUtilities.Unquote("abc\"xyz\"\"", out doubleQuotesRemoved).ShouldBe("abcxyz\""); 403QuotingUtilities.Unquote("abc\"\"xyz", out doubleQuotesRemoved).ShouldBe("abcxyz"); 407QuotingUtilities.Unquote("abc\"\"cde\"\"xyz", out doubleQuotesRemoved).ShouldBe("abccdexyz"); 415string unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out var doubleQuotesRemovedFromArg); 420unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 425unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 430unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 437unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 442unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 447unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 452unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 461var unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out var doubleQuotesRemovedFromArg); 466unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 471unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 476unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 481unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 486unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); 491unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg);
MSBuild (18)
CommandLineSwitches.cs (3)
542switchParameters = QuotingUtilities.Unquote(switchParameters); 547_parameterizedSwitches[(int)parameterizedSwitch].parameters.AddRange(QuotingUtilities.SplitUnquoted(switchParameters, int.MaxValue, false /* discard empty parameters */, unquoteParameters, out emptyParameters, s_parameterSeparators)); 558switchParameters = QuotingUtilities.Unquote(switchParameters);
XMake.cs (15)
1982var commandLineArgs = QuotingUtilities.SplitUnquoted(commandLine); 1984s_exeName = FileUtilities.FixFilePath(QuotingUtilities.Unquote(commandLineArgs[0])); 2034string unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out var doubleQuotesRemovedFromArg); 2150string unquotedSwitchIndicatorAndName = QuotingUtilities.Unquote(commandLineArg.Substring(0, quotedSwitchParameterIndicator), out var doubleQuotesRemovedFromSwitchIndicatorAndName); 2261argsFromResponseFile.AddRange(QuotingUtilities.SplitUnquoted(Environment.ExpandEnvironmentVariables(responseFileLine))); 4233string unquotedParameter = QuotingUtilities.Unquote(parameter); 4255var loggerSpec = QuotingUtilities.SplitUnquoted(parameter, 2, true /* keep empty splits */, false /* keep quotes */, out _, '*'); 4260string unquotedParameter = QuotingUtilities.Unquote(loggerSpec[0]); 4274unquotedParameter = QuotingUtilities.Unquote(loggerSpec[1]); 4301var loggerSpec = QuotingUtilities.SplitUnquoted(parameter, 2, true /* keep empty splits */, false /* keep quotes */, out _, ';'); 4313loggerParameters = QuotingUtilities.Unquote(loggerSpec[1]); 4317var loggerTypeSpec = QuotingUtilities.SplitUnquoted(loggerSpec[0], int.MaxValue, true /* keep empty splits */, false /* keep quotes */, out _, ','); 4326loggerClassName = QuotingUtilities.Unquote(loggerTypeSpec[0]); 4327loggerAssemblySpec = QuotingUtilities.Unquote(loggerTypeSpec[1]); 4332loggerAssemblySpec = QuotingUtilities.Unquote(loggerTypeSpec[0]);