CommandLineBuilderExtension 类

定义

CommandLineBuilder 派生类,用于特定于 MSBuild 任务的专用逻辑CommandLineBuilder derived class for specialized logic specific to MSBuild tasks

此 API 支持产品基础结构,不能在代码中直接使用。

public ref class CommandLineBuilderExtension : Microsoft::Build::Utilities::CommandLineBuilder
public class CommandLineBuilderExtension : Microsoft.Build.Utilities.CommandLineBuilder
type CommandLineBuilderExtension = class
    inherit CommandLineBuilder
Public Class CommandLineBuilderExtension
Inherits CommandLineBuilder
继承
CommandLineBuilderExtension

构造函数

CommandLineBuilderExtension()

此 API 支持产品基础结构,不能在代码中直接使用。

初始化 CommandLineBuilderExtension 类的新实例。Initializes a new instance of the CommandLineBuilderExtension class.

CommandLineBuilderExtension(Boolean, Boolean)

初始化 CommandLineBuilderExtension 类的新实例。Initializes a new instance of the CommandLineBuilderExtension class.

属性

CommandLine

检索继承类的私有 StringBuilder 实例Retrieves the private StringBuilder instance for inheriting classes

(继承自 CommandLineBuilder)
Length

返回当前命令的长度Returns the length of the current command

(继承自 CommandLineBuilder)

方法

AppendFileNameIfNotNull(ITaskItem)

如有必要,追加文件名引用它。Appends a file name quoting it if necessary. 此方法在命令行的后面追加一个空格 (如果它当前在文件名之前不为空) 。This method appends a space to the command line (if it's not currently empty) before the file name.

(继承自 CommandLineBuilder)
AppendFileNameIfNotNull(String)

如有必要,追加文件名引用它。Appends a file name quoting it if necessary. 此方法在命令行的后面追加一个空格 (如果它当前在文件名之前不为空) 。This method appends a space to the command line (if it's not currently empty) before the file name.

(继承自 CommandLineBuilder)
AppendFileNamesIfNotNull(ITaskItem[], String)

将 ITaskItem 规范数组作为文件名追加,如有必要,将其括起来,并用分隔符分隔。Appends array of ITaskItem specs as file names, quoting them if necessary, delimited by a delimiter. 此方法在命令行的后面追加一个空格 (如果它当前在文件名之前不为空) 。This method appends a space to the command line (if it's not currently empty) before the file names.

(继承自 CommandLineBuilder)
AppendFileNamesIfNotNull(String[], String)

追加文件名字符串的数组,如有必要,将其括在引号中,并用分隔符分隔。Appends array of file name strings, quoting them if necessary, delimited by a delimiter. 此方法在命令行的后面追加一个空格 (如果它当前在文件名之前不为空) 。This method appends a space to the command line (if it's not currently empty) before the file names.

(继承自 CommandLineBuilder)
AppendFileNameWithQuoting(String)

追加文件名。Appends a file name. 如果需要,则添加引号。Quotes are added if they are needed. 如果文件名的第一个字符为短划线,则为 ""。 " 为避免混淆文件名与开关混淆,此方法不会在执行前将空格追加到命令行。If the first character of the file name is a dash, "." is prepended to avoid confusing the file name with a switch This method does not append a space to the command line before executing.

(继承自 CommandLineBuilder)
AppendQuotedTextToBuffer(StringBuilder, String)

必要时在缓冲区的第一个用引号引起来的文本后面追加给定文本。Appends given text to the buffer after first quoting the text if necessary.

(继承自 CommandLineBuilder)
AppendSpaceIfNotEmpty()

当且仅当指定的字符串不为空时,将其添加到指定的字符串。Add a space or newline to the specified string if and only if it's not empty.

(继承自 CommandLineBuilder)
AppendSwitch(String)

追加一个没有任何引号的命令行开关,该开关不包含任何值。Appends a command-line switch that has no separate value, without any quoting. 此方法在命令行 (后面追加一个空格,如果在开关之前) 当前不为空。This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchIfNotNull(String, ITaskItem)

追加开关 [重载] 此方法在命令行 (后面追加一个空格,如果在开关之前) 当前不为空。Append a switch [overload] This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchIfNotNull(String, ITaskItem[], String)

追加一个命令行开关,该开关采用 ITaskItem [] 参数,并在必要时在各个文件名两侧加上双引号。Appends a command-line switch that takes a ITaskItem[] parameter, and add double-quotes around the individual filenames if necessary. 此方法在命令行 (后面追加一个空格,如果在开关之前) 当前不为空。This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchIfNotNull(String, String)

追加一个命令行开关,该开关采用单个字符串参数,如有必要,将参数括起来。Appends a command-line switch that takes a single string parameter, quoting the parameter if necessary. 此方法在命令行 (后面追加一个空格,如果在开关之前) 当前不为空。This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchIfNotNull(String, String[], String)

追加一个命令行开关,该开关采用 string [] 参数,并在必要时在各个文件名的两侧加上双引号。Appends a command-line switch that takes a string[] parameter, and add double-quotes around the individual filenames if necessary. 此方法在命令行 (后面追加一个空格,如果在开关之前) 当前不为空。This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchUnquotedIfNotNull(String, ITaskItem)

追加文本参数,而不尝试用引号引起来。Appends the literal parameter without trying to quote. 此方法在命令行 (后面追加一个空格,如果在开关之前) 当前不为空。This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchUnquotedIfNotNull(String, ITaskItem[], String)

追加一个命令行开关,该开关采用 ITaskItem [] 参数,而不是将单个参数引起来,此方法在命令行后面追加一个空格 (如果在开关之前) 当前不为空。Appends a command-line switch that takes a ITaskItem[] parameter, not quoting the individual parameters This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchUnquotedIfNotNull(String, String)

追加文本参数,而不尝试用引号引起来。Appends the literal parameter without trying to quote. 此方法在命令行 (后面追加一个空格,如果在开关之前) 当前不为空。This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendSwitchUnquotedIfNotNull(String, String[], String)

追加一个命令行开关,该开关采用 string [] 参数,而不是将单个参数括起来此方法在命令行后面追加一个空格 (如果在开关之前) 当前不为空。Appends a command-line switch that takes a string[] parameter, not quoting the individual parameters This method appends a space to the command line (if it's not currently empty) before the switch.

(继承自 CommandLineBuilder)
AppendTextUnquoted(String)

追加字符串。Appends a string. 不添加任何引号。No quotes are added. 此方法不会在执行之前向命令行追加空格。This method does not append a space to the command line before executing.

(继承自 CommandLineBuilder)
AppendTextWithQuoting(String)

追加字符串。Appends a string. 如果需要,则添加引号。Quotes are added if they are needed. 此方法不会在执行之前向命令行追加空格。This method does not append a space to the command line before executing.

(继承自 CommandLineBuilder)
Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetQuotedText(String)

此 API 支持产品基础结构,不能在代码中直接使用。

返回适合追加到命令行的带引号的字符串。Returns a quoted string appropriate for appending to a command line.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
IsQuotingRequired(String)

检查给定的开关参数,以确定它是否必须为引号。Checks the given switch parameter to see if it must/can be quoted.

(继承自 CommandLineBuilder)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

以字符串形式返回命令行。Return the command-line as a string.

(继承自 CommandLineBuilder)
VerifyThrowNoEmbeddedDoubleQuotes(String, String)

如果参数中有双引号,则引发。Throws if the parameter has a double-quote in it. 这用于防止参数注入。This is used to prevent parameter injection. 它是虚拟的,因此,如果需要在文件名中转义引号,则工具可以重写此方法It's virtual so that tools can override this method if they want to have quotes escaped in filenames

(继承自 CommandLineBuilder)

适用于