本文整理汇总了C++中str::Str::Replace方法的典型用法代码示例。如果您正苦于以下问题:C++ Str::Replace方法的具体用法?C++ Str::Replace怎么用?C++ Str::Replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类str::Str
的用法示例。
在下文中一共展示了Str::Replace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BStrToString
// the result doesn't have to be free()d but is only valid until the next call to this function
static const char *GetUndecoratedSymbolName(IDiaSymbol *symbol, const char *defName = "<noname>")
{
static str::Str<char> strTmp;
BSTR name = NULL;
#if 0
DWORD undecorateOptions = UNDNAME_COMPLETE;
#else
DWORD undecorateOptions = UNDNAME_NO_MS_KEYWORDS |
UNDNAME_NO_FUNCTION_RETURNS |
UNDNAME_NO_ALLOCATION_MODEL |
UNDNAME_NO_ALLOCATION_LANGUAGE |
UNDNAME_NO_THISTYPE |
UNDNAME_NO_ACCESS_SPECIFIERS |
UNDNAME_NO_THROW_SIGNATURES |
UNDNAME_NO_MEMBER_TYPE |
UNDNAME_NO_RETURN_UDT_MODEL |
UNDNAME_NO_ECSU;
#endif
if (S_OK == symbol->get_undecoratedNameEx(undecorateOptions, &name)) {
BStrToString(strTmp, name, "", true);
if (str::Eq(strTmp.Get(), "`string'"))
return "*str";
strTmp.Replace("(void)", "()");
// more ideas for undecoration:
// http://google-breakpad.googlecode.com/svn/trunk/src/common/windows/pdb_source_line_writer.cc
} else {
// Unfortunately it does happen that get_undecoratedNameEx() fails
// e.g. for RememberDefaultWindowPosition() in Sumatra code
symbol->get_name(&name);
BStrToString(strTmp, name, defName, true);
}
SysFreeStringSafe(name);
return strTmp.Get();
}