get the temp path include trailing delimiter. system default or temp_user. responsitility of the user if temp_user is a valid and terminated path. optional user defined temp path temp path to use
| 399 | /// <param name="temp_user">optional user defined temp path</param> |
| 400 | /// <returns>temp path to use</returns> |
| 401 | std::string temp_path(std::string temp_user) { |
| 402 | std::string td; |
| 403 | if (temp_user.empty()) { |
| 404 | td = std::filesystem::temp_directory_path().string(); |
| 405 | if (td.empty()) { |
| 406 | td = "."; |
| 407 | } |
| 408 | } else { |
| 409 | td = temp_user; |
| 410 | } |
| 411 | if (td.back() != DIRECTORY_SLASH) { |
| 412 | td += DIRECTORY_SLASH; |
| 413 | } |
| 414 | return td; |
| 415 | } |
| 416 | |
| 417 | /// replace all occurrences of search in subject with replace and return new string |
| 418 | std::string ReplaceString(const std::string& subject, const std::string& search, const std::string& replace) { |
no test coverage detected