예제 #1
0
string Hearthstone::LogConfigPath() {
#ifdef Q_WS_MAC
  QString homeLocation = QDesktopServices::storageLocation( QDesktopServices::HomeLocation );
  QString configPath = homeLocation + "/Library/Preferences/Blizzard/Hearthstone/log.config";
#elif defined Q_WS_WIN
  char buffer[ MAX_PATH ];
  SHGetSpecialFolderPathA( NULL, buffer, CSIDL_LOCAL_APPDATA, FALSE );
  QString localAppData( buffer );
  QString configPath = localAppData + "\\Blizzard\\Hearthstone\\log.config";
#endif
  return configPath.toStdString();
}
예제 #2
0
std::string FileSystem::GetLocalAppDataDirectoryPath()
{
    TCHAR directoryName[MAX_PATH];

    auto hr = SHGetFolderPath(nullptr, CSIDL_LOCAL_APPDATA, nullptr, 0, directoryName);
    if (FAILED(hr)) {
        POMDOG_THROW_EXCEPTION(std::runtime_error,
            "Failed to get AppData path.");
    }

    ///@todo FIXME
    constexpr auto productName = "Pomdog";

    std::string localAppData(directoryName);
    return PathHelper::Join(localAppData, productName);
}