Share via


IVsTextImageUtilities.GetReplaceText Method

Definition

Gets replace text for find/replace operations.

public:
 int GetReplaceText(System::UInt32 grfOptions, System::String ^ pszReplace, Microsoft::VisualStudio::TextManager::Interop::IVsTextImage ^ pText, cli::array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> ^ pMatch, Microsoft::VisualStudio::TextManager::Interop::IVsTextSpanSet ^ pTags, [Runtime::InteropServices::Out] System::String ^ % pbstrComputedText);
int GetReplaceText(unsigned int grfOptions, std::wstring const & pszReplace, Microsoft::VisualStudio::TextManager::Interop::IVsTextImage const & pText, std::Array <Microsoft::VisualStudio::TextManager::Interop::TextSpan> const & pMatch, Microsoft::VisualStudio::TextManager::Interop::IVsTextSpanSet const & pTags, [Runtime::InteropServices::Out] std::wstring const & & pbstrComputedText);
public int GetReplaceText (uint grfOptions, string pszReplace, Microsoft.VisualStudio.TextManager.Interop.IVsTextImage pText, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] pMatch, Microsoft.VisualStudio.TextManager.Interop.IVsTextSpanSet pTags, out string pbstrComputedText);
abstract member GetReplaceText : uint32 * string * Microsoft.VisualStudio.TextManager.Interop.IVsTextImage * Microsoft.VisualStudio.TextManager.Interop.TextSpan[] * Microsoft.VisualStudio.TextManager.Interop.IVsTextSpanSet * string -> int
Public Function GetReplaceText (grfOptions As UInteger, pszReplace As String, pText As IVsTextImage, pMatch As TextSpan(), pTags As IVsTextSpanSet, ByRef pbstrComputedText As String) As Integer

Parameters

grfOptions
UInt32

[in] Find options. Values are from the vsFindOptions enum.

pszReplace
String

[in] Replacement string.

pText
IVsTextImage

[in] Text image containing string to replace.

pMatch
TextSpan[]

[in] The Find match.

pTags
IVsTextSpanSet

[in] Optional, set of text spans describing the Find match. Obtained by GetTaggedSpans(IVsTextSpanSet).

pbstrComputedText
String

[out] The replace text string.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textfind.idl:

HRESULT IVsTextImageUtilities::GetReplaceText(  
   [in] VSFINDOPTIONS grfOptions,  
   [in] LPCOLESTR pszReplace,  
   [in] IVsTextImage * pText,  
   [in] const TextSpan * pMatch,  
   [in] IVsTextSpanSet * pTags,  
   [out, retval] BSTR * pbstrComputedText  
);  

If you do not have a regex find/replace with tags, pTags can be null. If you have pTags, pMatch can be null.

Applies to