* @brief Get folder for temporary files. * This function returns system temp folder. * @return Temp path, or empty string if error happened. * @note Temp path is cached after first call. * @todo Should we return `nullptr` for error case? */
| 45 | * @todo Should we return `nullptr` for error case? |
| 46 | */ |
| 47 | String GetTemporaryPath() |
| 48 | { |
| 49 | if (strTempPath.empty()) |
| 50 | { |
| 51 | strTempPath = GetSystemTempPath(); |
| 52 | if (strTempPath.empty()) |
| 53 | return strTempPath; |
| 54 | |
| 55 | paths::CreateIfNeeded(strTempPath); |
| 56 | } |
| 57 | return strTempPath; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * @brief Get filename for temporary file. |