IVsFindHelper.FindInText(String, String, UInt32, UInt32, UInt32, UInt16[], UInt32, UInt32, String, Int32) Método

Definição

Localiza e, opcionalmente, substitui um padrão de texto em uma cadeia de texto.

public:
 int FindInText(System::String ^ pszFind, System::String ^ pszReplace, System::UInt32 grfFindOptions, System::UInt32 grfBufferFlags, System::UInt32 cchText, cli::array <System::UInt16> ^ pchText, [Runtime::InteropServices::Out] System::UInt32 % piFound, [Runtime::InteropServices::Out] System::UInt32 % pcchFound, [Runtime::InteropServices::Out] System::String ^ % pbstrReplaceText, [Runtime::InteropServices::Out] int % pfFound);
int FindInText(std::wstring const & pszFind, std::wstring const & pszReplace, unsigned int grfFindOptions, unsigned int grfBufferFlags, unsigned int cchText, std::Array <unsigned short> const & pchText, [Runtime::InteropServices::Out] unsigned int & piFound, [Runtime::InteropServices::Out] unsigned int & pcchFound, [Runtime::InteropServices::Out] std::wstring const & & pbstrReplaceText, [Runtime::InteropServices::Out] int & pfFound);
public int FindInText (string pszFind, string pszReplace, uint grfFindOptions, uint grfBufferFlags, uint cchText, ushort[] pchText, out uint piFound, out uint pcchFound, out string pbstrReplaceText, out int pfFound);
abstract member FindInText : string * string * uint32 * uint32 * uint32 * uint16[] * uint32 * uint32 * string * int -> int
Public Function FindInText (pszFind As String, pszReplace As String, grfFindOptions As UInteger, grfBufferFlags As UInteger, cchText As UInteger, pchText As UShort(), ByRef piFound As UInteger, ByRef pcchFound As UInteger, ByRef pbstrReplaceText As String, ByRef pfFound As Integer) As Integer

Parâmetros

pszFind
String

no Padrão de texto a ser localizado.

pszReplace
String

no Padrão de texto de substituição.

grfFindOptions
UInt32

no Opções de pesquisa. Os valores são obtidos da __VSFINDOPTIONS enumeração.

grfBufferFlags
UInt32

no Sinalizador que indica que pchText o inicia ou termina uma linha. Os valores são obtidos da __VSFINDBUFFERFLAGS enumeração.

cchText
UInt32

no Tamanho do texto, em caracteres Unicode.

pchText
UInt16[]

[in, size_is (cchText)] Buffer de texto a ser pesquisado pszFind .

piFound
UInt32

fora Índice no buffer que aponta para correspondência.

pcchFound
UInt32

fora Comprimento da correspondência encontrado.

pbstrReplaceText
String

fora Texto de substituição computado, se necessário.

pfFound
Int32

[out, retval] true se o padrão foi encontrado.

Retornos

Int32

Se o método for bem-sucedido, retornará S_OK. Se falhar, retornará um código de erro.

Comentários

Assinatura COM

De textfind. idl:

HRESULT IVsFindHelper::FindInText(  
   [in] LPCOLESTR pszFind,  
   [in] LPCOLESTR pszReplace,  
   [in] VSFINDOPTIONS grfFindOptions,  
   [in] VSFINDBUFFERFLAGS grfBufferFlags,  
   [in] ULONG cchText,  
   [in,size_is(cchText)] LPCOLESTR pchText,  
   [out] ULONG * piFound,  
   [out] ULONG * pcchFound, [out] BSTR * pbstrReplaceText  
);  

Um IVsFindHelper ponteiro de interface é passado para Find e Replace . Se você quiser dar suporte a curingas, expressões regulares ou palavras inteiras, use FindInText para fazer a correspondência de cadeia de caracteres para que todas as opções e o comportamento funcionem consistentemente com o editor do Visual Studio.

O texto de substituição computado é retornado em pbstrReplaceText .

O texto de substituição computado é necessário nas seguintes condições:

  • FR_RegExpr, FR_Replace , as opções são especificadas e as marcas ou os escapes de caractere aparecem em pszReplace .

  • FR_KeepCase a opção está especificada.

Aplica-se a