• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ gtString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中gtString的典型用法代码示例。如果您正苦于以下问题:C++ gtString类的具体用法?C++ gtString怎么用?C++ gtString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了gtString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: IsLinuxSystemModuleNoExt

static bool IsLinuxSystemModuleNoExt(const gtString& absolutePath)
{
    // Kernel samples
    bool ret = (absolutePath.find(L"[kernel.kallsyms]") != -1);

    if (!ret && L'/' == absolutePath[0])
    {
        if (absolutePath.compare(1, 3, L"lib") == 0)
        {
            ret = true;
        }
        else
        {
            if (absolutePath.compare(1, 4, L"usr/") == 0)
            {
                if (absolutePath.compare(5, 3,  L"lib")       ||
                    absolutePath.compare(5, 9,  L"local/lib") ||
                    absolutePath.compare(5, 10, L"share/gdb") == 0)
                {
                    ret = true;
                }
            }
        }
    }

    return ret;
}
开发者ID:imace,项目名称:CodeXL,代码行数:27,代码来源:Utils.cpp


示例2: readLine

int CpuProfileInputStream::readLine(gtString& str)
{
    wchar_t buf = L'\0';
    str.makeEmpty();

    if (!m_fileStream.isOpened())
    {
        return -1;
    }

    while (!isEof())
    {
        buf = fgetwc(m_fileStream.getHandler());

        if (buf == (wchar_t) WEOF)
        {
            break;
        }

        if (buf != L'\n')
        {
            str += buf;
        }
        else
        {
            str += L'\0';
            break;
        }
    }

    return str.length();
}
开发者ID:CSRedRat,项目名称:CodeXL,代码行数:32,代码来源:CpuProfileInputStream.cpp


示例3: writeSession

void OpenCLTraceOptions::writeSession(gtString& projectAsXMLString, const gtString& type)
{
    gtString numVal;

    projectAsXMLString.append(L"<Session type=\"");
    projectAsXMLString.append(type);
    projectAsXMLString.append(L"\">");

    gtString apiTypeStr = (m_currentSettings.m_apiToTrace == APIToTrace_OPENCL) ? GPU_STR_ProjectSettingsAPITypeOpenCL : GPU_STR_ProjectSettingsAPITypeHSA;
    writeValue(projectAsXMLString, GPU_STR_ProjectSettingsAPIType, apiTypeStr);
    writeBool(projectAsXMLString, GPU_STR_ProjectSettingsGenerateOccupancy, m_currentSettings.m_generateKernelOccupancy);
    writeBool(projectAsXMLString, GPU_STR_ProjectSettingsShowErrorCode, m_currentSettings.m_alwaysShowAPIErrorCode);
    writeBool(projectAsXMLString, GPU_STR_ProjectSettingsCollapseClGetEventInfo, m_currentSettings.m_collapseClGetEventInfo);
    writeBool(projectAsXMLString, GPU_STR_ProjectSettingsEnableNavigation, m_currentSettings.m_generateSymInfo);
    writeBool(projectAsXMLString, GPU_STR_ProjectSettingsGenerateSummaryPage, m_currentSettings.m_generateSummaryPage);
    writeBool(projectAsXMLString, GPU_STR_ProjectSettingsAPIsToFilter, m_currentSettings.m_filterAPIsToTrace);
    numVal.makeEmpty();
    numVal.appendFormattedString(L"%d", m_currentSettings.m_maxAPICalls);
    writeValue(projectAsXMLString, GPU_STR_ProjectSettingsMaxAPIs, numVal);

    writeBool(projectAsXMLString, GPU_STR_ProjectSettingsWriteDataTimeOut, m_currentSettings.m_writeDataTimeOut);
    numVal.makeEmpty();
    numVal.appendFormattedString(L"%d", m_currentSettings.m_timeoutInterval);
    writeValue(projectAsXMLString, GPU_STR_ProjectSettingsTimeOutInterval, numVal);

    QStringList rulesList;
    m_currentSettings.GetListOfRules(rulesList);
    AppendTree(projectAsXMLString, acGTStringToQString(GPU_STR_ProjectSettingsRulesTree), rulesList);
    AppendTree(projectAsXMLString, acGTStringToQString(GPU_STR_ProjectSettingsAPIsFilterTree), m_currentSettings.m_pFilterManager->APIFilterSet());

    projectAsXMLString.append(L"</Session>");
}
开发者ID:PlusChie,项目名称:CodeXL,代码行数:32,代码来源:OpenCLTraceSettingPage.cpp


示例4: getProjectSettingsXML

bool OpenCLTraceOptions::getProjectSettingsXML(gtString& projectAsXMLString, gtString& projectPage)
{
    projectAsXMLString.appendFormattedString(L"<%ls>", projectPage.asCharArray());
    writeSession(projectAsXMLString, L"Current");
    projectAsXMLString.appendFormattedString(L"</%ls>", projectPage.asCharArray());

    return true;
}
开发者ID:PlusChie,项目名称:CodeXL,代码行数:8,代码来源:OpenCLTraceSettingPage.cpp


示例5: open

bool CpuProfileInputStream::open(const gtString& path)
{
    if (path.isEmpty())
    {
        return false;
    }

    // Check if file is already open
    if (m_fileStream.isOpened())
    {
        if (path != m_path)
        {
            // Close and open a new file
            close();
        }
        else
        {
            return true;
        }
    }

    // Windows Note:
    // The profile files are opened with UTF-8 encoding.
    //
    if (!m_fileStream.open(path.asCharArray(), WINDOWS_SWITCH(FMODE_TEXT("r, ccs=UTF-8"), FMODE_TEXT("rb"))))
    {
        return false;
    }

    // Set path name
    m_path = path;

#if AMDT_BUILD_TARGET == AMDT_LINUX_OS

    if (fwide(m_fileStream.getHandler(), 1) <= 0)
    {
        close();
        return false;
    }

    // Note: For Linux
    // Due to a bug in some version of gcc,
    // we add this to make sure that we are
    // starting from the beginning of the file.
    m_fileStream.seekCurrentPosition(CrtFile::ORIGIN_BEGIN, 0);
#endif
    getCurrentPosition(&m_bof);

    // Get length of file
    m_fileStream.seekCurrentPosition(CrtFile::ORIGIN_END, 0);
    getCurrentPosition(&m_eof);

    // Back to the beginning of file
    setCurrentPosition(&m_bof);
    return true;
}
开发者ID:CSRedRat,项目名称:CodeXL,代码行数:56,代码来源:CpuProfileInputStream.cpp


示例6: ParseStatistics

bool kcVulkanStatisticsParser::ParseStatistics(const gtString& satisticsFilePath, beKA::AnalysisData& parsedStatistics)
{
    bool ret = false;
    parsedStatistics.ISASize = 0;
    parsedStatistics.numSGPRsUsed = 0;
    parsedStatistics.numVGPRsUsed = 0;

    // Check if the file exists.
    if (!satisticsFilePath.isEmpty())
    {
        osFilePath filePath(satisticsFilePath);

        if (filePath.exists())
        {
            std::ifstream file(satisticsFilePath.asASCIICharArray());
            std::string fileContent((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());

            if (!fileContent.empty())
            {
                // Extract the ISA size in bytes.
                size_t isaSizeInBytes = 0;
                bool isIsaSizeExtracted = ExtractIsaSize(fileContent, isaSizeInBytes);

                if (isIsaSizeExtracted)
                {
                    parsedStatistics.ISASize = isaSizeInBytes;
                }

                // Extract the number of used SGPRs.
                size_t usedSgprs = 0;
                bool isSgprsExtracted = ExtractUsedSgprs(fileContent, usedSgprs);

                if (isSgprsExtracted)
                {
                    parsedStatistics.numSGPRsUsed = usedSgprs;
                }

                // Extract the number of used VGPRs.
                size_t usedVgprs = 0;
                bool isVgprsExtracted = ExtractUsedVgprs(fileContent, usedVgprs);

                if (isVgprsExtracted)
                {
                    parsedStatistics.numVGPRsUsed = usedVgprs;
                }

                // We succeeded if all data was extracted successfully.
                ret = (isIsaSizeExtracted && isSgprsExtracted && isVgprsExtracted);
            }
        }
    }

    return ret;
}
开发者ID:GPUOpen-Tools,项目名称:amd-codexl-analyzer,代码行数:54,代码来源:kcVulkanStatisticsParser.cpp


示例7: oaMessageBoxDisplayCB

// ---------------------------------------------------------------------------
// Name:        osMessageBox::display
// Description:
//   Displays the message box.
//   The message box will be displayed in a "Modal" way (blocks the application
//   GUI until the user close the message box).
// Author:      AMD Developer Tools Team
// Date:        6/10/2004
// ---------------------------------------------------------------------------
void oaMessageBoxDisplayCB(const gtString& title, const gtString& message, osMessageBox::osMessageBoxIcon icon, /*oaWindowHandle*/ void* hParentWindow)
{
    // The message box will have a single "Ok" button:
    UINT okButtonStyle = MB_OK;

    // Translate the icon to Win32 style:
    unsigned int iconStyle = oaMessageBoxIconToOSStyle(icon);

    // Combine the styles into a styles mask:
    UINT messageBoxWin32Style = okButtonStyle | iconStyle;

    // Display the message box:
    MessageBox((oaWindowHandle)hParentWindow, message.asCharArray(), title.asCharArray(), messageBoxWin32Style);
}
开发者ID:davidlee80,项目名称:amd-codexl-analyzer,代码行数:23,代码来源:oaMessageBox.cpp


示例8: openFile

// ---------------------------------------------------------------------------
// Name:        afWin32RedirectionManager::openFile
// Description: open the file with the needed access and create flags
// Author:      AMD Developer Tools Team
// Date:        20/6/2013
// ---------------------------------------------------------------------------
bool osProcessSharedFile::openFile(gtString& fileName, bool openForWrite, bool openForAppend)
{
    bool retVal = false;

    DWORD desiredAccess = GENERIC_READ;
    DWORD desiredCreate = OPEN_ALWAYS;

    if (openForWrite)
    {
        // Open the file according to the directive type:
        desiredAccess = openForAppend ? FILE_APPEND_DATA : GENERIC_WRITE;
        desiredCreate = openForAppend ? OPEN_ALWAYS : CREATE_ALWAYS;
    }

    SECURITY_ATTRIBUTES securityAtributes;
    securityAtributes.nLength = sizeof(SECURITY_ATTRIBUTES);
    securityAtributes.lpSecurityDescriptor = NULL;
    securityAtributes.bInheritHandle = TRUE;
    HANDLE tempHandle = CreateFile(fileName.asCharArray(), desiredAccess , FILE_SHARE_WRITE, &securityAtributes, desiredCreate, FILE_ATTRIBUTE_NORMAL, 0);

    if (tempHandle != INVALID_HANDLE_VALUE)
    {
        retVal = true;
        m_fileHandle = tempHandle;
    }

    return retVal;
}
开发者ID:davidlee80,项目名称:amd-gpuperfstudio-dx12,代码行数:34,代码来源:osProcessSharedFile.cpp


示例9: GetAggregationString

bool ppCliUtils::GetAggregationString(AMDTPwrAggregation aggregationType, gtString& aggregationStr)
{
    bool ret = true;
    const char* pStr = nullptr;

    switch (aggregationType)
    {
        case AMDT_PWR_VALUE_SINGLE:
            pStr = STR_AMDT_PWR_AGG_SINGLE;
            break;

        case AMDT_PWR_VALUE_CUMULATIVE:
            pStr = STR_AMDT_PWR_AGG_CUMULATIVE;
            break;

        case AMDT_PWR_VALUE_HISTOGRAM:
            pStr = STR_AMDT_PWR_AGG_HISTOGRAM;
            break;

        default:
            // This aggregation type is unknown and should be added.
            pStr = STR_AMDT_PWR_AGG_UNKNOWN;
            ret = false;
            break;
    }

    aggregationStr.fromASCIIString(pStr);

    return ret;
}
开发者ID:StephenThomasUWTSD,项目名称:CodeXL,代码行数:30,代码来源:ppCliUtils.cpp


示例10: ConstructProfiledCounterDesc

void ppReporterText::ConstructProfiledCounterDesc(gtString& counterName, const AMDTPwrCounterDesc*& counterDesc)
{
    gtString categoryStr;
    ppCliUtils::GetCategoryString(counterDesc->m_category, categoryStr);

    gtString unitStr;
    ppCliUtils::GetUnitString(counterDesc->m_units, unitStr);

    memset(m_pDataStr, 0, m_DataStrSize);
    //sprintf(m_pDataStr, "    %6d.         %-15.15s %-15.15s %7.2f         %7.2f         %-15.15s %s\n",
    //        counterDesc->m_counterID,
    //        counterName.asASCIICharArray(),
    //        categoryStr,
    //        counterDesc->m_minValue,
    //        counterDesc->m_maxValue,
    //        unitStr,
    //        counterDesc->m_description);

    sprintf(m_pDataStr, "    %6d.         %-25.25s %-15.15s %-15.15s %s\n",
            counterDesc->m_counterID,
            counterName.asASCIICharArray(),
            categoryStr.asASCIICharArray(),
            unitStr.asASCIICharArray(),
            counterDesc->m_description);

    return;
} // ConstructProfiledCounterDesc
开发者ID:oldwinter,项目名称:CodeXL,代码行数:27,代码来源:ppReporter.cpp


示例11: GetLiveRegAnalyzerPath

beKA::beStatus beKA::beStaticIsaAnalyzer::GenerateControlFlowGraph(const gtString& isaFileName, const gtString& outputFileName)
{
    beStatus ret = beStatus_General_FAILED;

    // Get the ISA analyzer's path.
    std::string analyzerPath;
    bool isOk = GetLiveRegAnalyzerPath(analyzerPath);

    if (isOk && !analyzerPath.empty())
    {
        // Validate the input ISA file.
        osFilePath isaFilePath(isaFileName);

        if (isaFilePath.exists())
        {
            // Construct the command.
            std::stringstream cmd;
            cmd << analyzerPath << " dump-pi-cfg " << isaFileName.asASCIICharArray()
                << " " << outputFileName.asASCIICharArray();

            // Cancel signal. Not in use for now.
            bool shouldCancel = false;

            gtString analyzerOutput;
            isOk = osExecAndGrabOutput(cmd.str().c_str(), shouldCancel, analyzerOutput);

            if (isOk)
            {
                ret = beStatus_SUCCESS;
            }
            else
            {
                ret = beStatus_shaeFailedToLaunch;
            }
        }
        else
        {
            ret = beStatus_shaeIsaFileNotFound;
        }
    }
    else
    {
        ret = beStatus_shaeCannotLocateAnalyzer;
    }

    return ret;
}
开发者ID:GPUOpen-Tools,项目名称:amd-codexl-analyzer,代码行数:47,代码来源:beStaticIsaAnalyzer.cpp


示例12: AuxIsLinuxSystemModule

// This function tries to tell whether a given module name is a Linux system library.
//
// The special name "[kernel.kallsyms]" is the module name for samples within the kernel.
// Then, if the path does not start with '/' we assume it's not a system library.
// The name must then start with "lib" and have ".so" within it.
// If so, we consider these files to be system libraries if they are from:
//          /lib*
//          /usr/lib*
//          /usr/local/lib*
//          /usr/share/gdb*
//
bool AuxIsLinuxSystemModule(const gtString& absolutePath)
{
    bool ret;

    int len = absolutePath.length();

    if (len > 3 && 0 == memcmp(absolutePath.asCharArray() + len - 3, L".so", 3 * sizeof(wchar_t)))
    {
        ret = IsLinuxSystemModuleNoExt(absolutePath);
    }
    else
    {
        ret = false;
    }

    return ret;
}
开发者ID:imace,项目名称:CodeXL,代码行数:28,代码来源:Utils.cpp


示例13: CreateDirHierarchy

bool dmnUtils::CreateDirHierarchy(const gtString& dirPath)
{
    bool ret = false;
#if AMDT_BUILD_TARGET == AMDT_WINDOWS_OS
    int rc = SHCreateDirectoryEx(NULL, dirPath.asCharArray(), NULL);
    ret = (0 == rc);
#elif AMDT_BUILD_TARGET == AMDT_LINUX_OS
    std::string cmd("mkdir -p ");
    cmd.append(dirPath.asASCIICharArray());
    int rc = system(cmd.c_str());
    ret = (rc != -1);
#else
#error Unknown build configuration!
#endif

    return ret;
}
开发者ID:PlusChie,项目名称:CodeXL,代码行数:17,代码来源:dmnUtils.cpp


示例14: IsSystemModule

bool IsSystemModule(const gtString& absolutePath)
{
    bool ret;

    if (absolutePath.length() > 4 && (absolutePath.endsWith(L".dll") ||
                                      absolutePath.endsWith(L".sys") ||
                                      absolutePath.endsWith(L".exe")))
    {
        ret = IsWindowsSystemModuleNoExt(absolutePath);
    }
    else
    {
        ret = AuxIsLinuxSystemModule(absolutePath);
    }

    return ret;
}
开发者ID:imace,项目名称:CodeXL,代码行数:17,代码来源:Utils.cpp


示例15: GetUnitString

bool ppCliUtils::GetUnitString(AMDTPwrUnit unitType, gtString& unitStr)
{
    bool ret = true;
    const char* pStr = nullptr;

    switch (unitType)
    {
        case AMDT_PWR_UNIT_TYPE_COUNT:
            pStr = STR_AMDT_PWR_UNIT_COUNT;
            break;

        case AMDT_PWR_UNIT_TYPE_PERCENT:
            pStr = STR_AMDT_PWR_UNIT_PERCENTAGE;
            break;

        case AMDT_PWR_UNIT_TYPE_RATIO:
            pStr = STR_AMDT_PWR_UNIT_RATIO;
            break;

        case AMDT_PWR_UNIT_TYPE_MILLI_SECOND:
            pStr = STR_AMDT_PWR_UNIT_MILLISEC;
            break;

        case AMDT_PWR_UNIT_TYPE_JOULE:
            pStr = STR_AMDT_PWR_UNIT_JOULE;
            break;

        case AMDT_PWR_UNIT_TYPE_WATT:
            pStr = STR_AMDT_PWR_UNIT_WATT;
            break;

        case AMDT_PWR_UNIT_TYPE_VOLT:
            pStr = STR_AMDT_PWR_UNIT_VOLT;
            break;

        case AMDT_PWR_UNIT_TYPE_MILLI_AMPERE:
            pStr = STR_AMDT_PWR_UNIT_MILLI_AMPERE;
            break;

        case AMDT_PWR_UNIT_TYPE_MEGA_HERTZ:
            pStr = STR_AMDT_PWR_UNIT_MEGAHERTZ;
            break;

        case AMDT_PWR_UNIT_TYPE_CENTIGRADE:
            pStr = STR_AMDT_PWR_UNIT_CENTIGRADE;
            break;

        default:
            // This unit is unknown and should be added.
            pStr = STR_AMDT_PWR_UNIT_UNKNOWN;
            ret = false;
            break;
    }

    unitStr.fromASCIIString(pStr);

    return ret;
} // GetUnitString
开发者ID:StephenThomasUWTSD,项目名称:CodeXL,代码行数:58,代码来源:ppCliUtils.cpp


示例16: markPos

void CpuProfileInputStream::markPos(const gtString& mark)
{
    if (!mark.isEmpty() && m_fileStream.isOpened() && !isEof())
    {
        fpos_t pos;
        getCurrentPosition(&pos);
        m_sectionMap.insert(SectionStreamPosMap::value_type(mark, pos));
    }
}
开发者ID:CSRedRat,项目名称:CodeXL,代码行数:9,代码来源:CpuProfileInputStream.cpp


示例17: osGetLastSystemErrorAsString

// ---------------------------------------------------------------------------
// Name:        osGetLastSystemErrorAsString
// Description: Outputs the last error code recorded by the operating system
//              for the calling thread, translated into a string.
// Author:      AMD Developer Tools Team
// Date:        28/1/2008
// ---------------------------------------------------------------------------
void osGetLastSystemErrorAsString(gtString& systemErrorAsString)
{
    systemErrorAsString = OS_STR_unknownSystemError;

    // Get the system's last recorded error code:
    osSystemErrorCode systemLastError = osGetLastSystemError();

    // If no system error was recorded:
    if (systemLastError == 0)
    {
        systemErrorAsString = OS_STR_noSystemError;
    }
    else
    {
#if GR_LINUX_VARIANT == GR_GENERIC_LINUX_VARIANT
        // Get a string describing the system error:
        char buff[OS_SYSTEM_ERROR_BUFF_SIZE];
        char* pErrMsg = strerror_r(systemLastError, buff, OS_SYSTEM_ERROR_BUFF_SIZE);

        if (pErrMsg != NULL)
        {
            // Output the string we got:
            systemErrorAsString.fromASCIIString(pErrMsg);
        }

#elif GR_LINUX_VARIANT == GR_MAC_OS_X_LINUX_VARIANT
        // Get a string describing the system error:
        char buff[OS_SYSTEM_ERROR_BUFF_SIZE + 1];
        int rc1 = strerror_r(systemLastError, buff, OS_SYSTEM_ERROR_BUFF_SIZE);

        if (rc1 == 0)
        {
            // Null-terminate the string:
            buff[OS_SYSTEM_ERROR_BUFF_SIZE] = '\0';

            // Output the string we got:
            systemErrorAsString.fromASCIIString(buff);
        }

#else
#error Unknown Linux variant
#endif
    }
}
开发者ID:davidlee80,项目名称:amd-gpuperfstudio-dx12,代码行数:51,代码来源:osSystemError.cpp


示例18: IsWindowsSystemModuleNoExt

static bool IsWindowsSystemModuleNoExt(const gtString& absolutePath)
{
    bool ret = false;

    // 21 is the minimum of: "\\windows\\system\\*.***"
    if (absolutePath.length() >= 21)
    {
        gtString lowerAbsolutePath = absolutePath;

        for (int i = 0, e = lowerAbsolutePath.length(); i != e; ++i)
        {
            wchar_t& wc = lowerAbsolutePath[i];

            if ('/' == wc)
            {
                wc = '\\';
            }
            else
            {
                // Paths in windows are case insensitive
                wc = tolower(wc);
            }
        }

        int rootPos = lowerAbsolutePath.find(L"\\windows\\");

        if (-1 != rootPos)
        {
            // 9 is the length of "\\windows\\"
            rootPos += 9;

            if (lowerAbsolutePath.compare(rootPos, 3, L"sys") == 0)
            {
                rootPos += 3;

                if (lowerAbsolutePath.compare(rootPos, 4, L"tem\\")   == 0 || // "\\windows\\system\\"
                    lowerAbsolutePath.compare(rootPos, 6, L"tem32\\") == 0 || // "\\windows\\system32\\"
                    lowerAbsolutePath.compare(rootPos, 6, L"wow64\\") == 0)   // "\\windows\\syswow64\\"
                {
                    ret = true;
                }
            }
            else
            {
                if (lowerAbsolutePath.compare(rootPos, 7, L"winsxs\\") == 0)
                {
                    ret = true;
                }
            }
        }
    }

    return ret;
}
开发者ID:imace,项目名称:CodeXL,代码行数:54,代码来源:Utils.cpp


示例19: GetCategoryString

bool ppCliUtils::GetCategoryString(AMDTPwrCategory category, gtString& categoryStr)
{
    bool ret = true;
    const char* pStr = nullptr;

    switch (category)
    {
        case AMDT_PWR_CATEGORY_POWER:
            pStr = STR_AMDT_PWR_CATEGORY_POWER;
            break;

        case AMDT_PWR_CATEGORY_TEMPERATURE:
            pStr = STR_AMDT_PWR_CATEGORY_TEMPERATURE;
            break;

        case AMDT_PWR_CATEGORY_FREQUENCY:
            pStr = STR_AMDT_PWR_CATEGORY_FREQUENCY;
            break;

        case AMDT_PWR_CATEGORY_CURRENT:
            pStr = STR_AMDT_PWR_CATEGORY_CURRENT;
            break;

        case AMDT_PWR_CATEGORY_VOLTAGE:
            pStr = STR_AMDT_PWR_CATEGORY_VOLTAGE;
            break;

        case AMDT_PWR_CATEGORY_DVFS:
            pStr = STR_AMDT_PWR_CATEGORY_DVFS;
            break;

        case AMDT_PWR_CATEGORY_PROCESS:
            pStr = STR_AMDT_PWR_CATEGORY_PROCESS;
            break;

        case AMDT_PWR_CATEGORY_TIME:
            pStr = STR_AMDT_PWR_CATEGORY_TIME;
            break;

        case AMDT_PWR_CATEGORY_COUNT:
            pStr = STR_AMDT_PWR_CATEGORY_COUNT;
            break;

        default:
            // This category is unknown and should be added.
            pStr = STR_AMDT_PWR_CATEGORY_UNKNOWN;
            ret = false;
            break;
    }

    categoryStr.fromASCIIString(pStr);

    return ret;
} // GetCategoryString
开发者ID:StephenThomasUWTSD,项目名称:CodeXL,代码行数:54,代码来源:ppCliUtils.cpp


示例20: GetDeviceTypeString

bool ppCliUtils::GetDeviceTypeString(AMDTDeviceType deviceType, gtString& deviceTypeStr)
{
    bool ret = true;
    const char* pStr = nullptr;

    switch (deviceType)
    {
        case AMDT_PWR_DEVICE_SYSTEM:
            pStr = STR_AMDT_PWR_DEVICE_SYSTEM;
            break;

        case AMDT_PWR_DEVICE_PACKAGE:
            pStr = STR_AMDT_PWR_DEVICE_PACKAGE;
            break;

        case AMDT_PWR_DEVICE_CPU_COMPUTE_UNIT:
            pStr = STR_AMDT_PWR_DEVICE_CPU_COMPUTE_UNIT;
            break;

        case AMDT_PWR_DEVICE_CPU_CORE:
            pStr = STR_AMDT_PWR_DEVICE_CPU_CORE;
            break;

        case AMDT_PWR_DEVICE_INTERNAL_GPU:
            pStr = STR_AMDT_PWR_DEVICE_INTERNAL_GPU;
            break;

        case AMDT_PWR_DEVICE_EXTERNAL_GPU:
            pStr = STR_AMDT_PWR_DEVICE_EXTERNAL_GPU;
            break;

        case AMDT_PWR_DEVICE_SVI2:
            pStr = STR_AMDT_PWR_DEVICE_SVI2;
            break;

        default:
            // This device type is unknown and should be added.
            pStr = STR_UNKNOWN_DEVICE_UNKNOWN;
            ret = false;
            break;
    }

    deviceTypeStr.fromASCIIString(pStr);

    return ret;
}
开发者ID:StephenThomasUWTSD,项目名称:CodeXL,代码行数:46,代码来源:ppCliUtils.cpp



注:本文中的gtString类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ guardt类代码示例发布时间:2022-05-31
下一篇:
C++ grpc_end2end_test_config类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap