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(); }
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); }