本文整理汇总了C++中str::Str::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ Str::Get方法的具体用法?C++ Str::Get怎么用?C++ Str::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类str::Str
的用法示例。
在下文中一共展示了Str::Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 *GetTypeName(IDiaSymbol *symbol)
{
static str::Str<char> strTmp;
BSTR name = NULL;
symbol->get_name(&name);
BStrToString(strTmp, name, "<noname>", true);
SysFreeStringSafe(name);
return strTmp.Get();
}
示例2: GetProgramInfo
void GetProgramInfo(str::Str<char>& s)
{
s.AppendFmt("Ver: %s", CURR_VERSION_STRA);
#ifdef SVN_PRE_RELEASE_VER
s.AppendFmt(" pre-release");
#endif
#ifdef DEBUG
if (!str::EndsWith(s.Get(), " (dbg)"))
s.Append(" (dbg)");
#endif
s.Append("\r\n");
}
示例3: GetProgramInfo
void GetProgramInfo(str::Str<char>& s) {
s.AppendFmt("Ver: %s", CURR_VERSION_STRA);
#ifdef SVN_PRE_RELEASE_VER
s.AppendFmt(" pre-release");
#endif
if (IsProcess64()) {
s.Append(" 64-bit");
}
#ifdef DEBUG
if (!str::Find(s.Get(), " (dbg)"))
s.Append(" (dbg)");
#endif
s.Append("\r\n");
#if defined(GIT_COMMIT_ID)
const char* gitSha1 = QM(GIT_COMMIT_ID);
s.AppendFmt("Git: %s (https://github.com/sumatrapdfreader/sumatrapdf/tree/%s)\r\n", gitSha1, gitSha1);
#endif
}
示例4: ProcessPdbFile
static void ProcessPdbFile(const char *fileNameA)
{
HRESULT hr;
IDiaDataSource * dia = NULL;
IDiaSession * session = NULL;
str::Str<char> report;
dia = LoadDia();
if (!dia)
return;
ScopedMem<WCHAR> fileName(str::conv::FromAnsi(fileNameA));
hr = dia->loadDataForExe(fileName, 0, 0);
if (FAILED(hr)) {
logf(" failed to load %s or its debug symbols from .pdb file\n", fileNameA);
goto Exit;
}
hr = dia->openSession(&session);
if (FAILED(hr)) {
log(" failed to open DIA session\n");
goto Exit;
}
if (g_dumpTypes)
DumpTypes(session);
if (g_dumpSections)
DumpSections(session);
if (g_dumpSymbols)
DumpSymbols(session);
fputs("Format: 1\n", stdout);
if (g_compact) {
str::Str<char> res;
GetInternedStringsReport(res);
fputs(res.Get(), stdout);
}
fputs(g_report.Get(), stdout);
Exit:
UnkReleaseSafe(session);
}