Exemple #1
0
bool dmnUtils::GetCurrentDirectory(gtString& buffer)
{
    osFilePath fileBuffer;
    bool ret = osGetCurrentApplicationPath(fileBuffer);
    GT_IF_WITH_ASSERT(ret)
    {
        buffer = fileBuffer.fileDirectoryAsString();
    }
    return ret;
}
Exemple #2
0
bool InitializeEventsXMLFile(EventsFile& eventsFile)
{
    bool rv = true;
    osCpuid cpuInfo;
    int model = cpuInfo.getModel();

    osFilePath eventFilePath;
    EventEngine eventEngine;

    // Construct the path for family specific Events XML files
    if (osGetCurrentApplicationDllsPath(eventFilePath) || osGetCurrentApplicationPath(eventFilePath))
    {
        eventFilePath.clearFileName();
        eventFilePath.clearFileExtension();

        eventFilePath.appendSubDirectory(L"Data");
        eventFilePath.appendSubDirectory(L"Events");

        const gtString eventFilePathStr = eventFilePath.fileDirectoryAsString();

        if (!eventEngine.Initialize(convertToQString(eventFilePathStr)))
        {
            rv = false;
        }
    }

    if (rv)
    {
        // Get event file path
        QString eventFile;
        eventFile = eventEngine.GetEventFilePath(cpuInfo.getFamily(), model);

        // Initialize event file
        if (!eventsFile.Open(eventFile))
        {
            rv = false;
        }
    }

    return rv;
}