Gets the path to a temporary directory. */
| 123 | |
| 124 | /** Gets the path to a temporary directory. */ |
| 125 | std::string Path_GetTemporaryDirectory() |
| 126 | { |
| 127 | #if defined( _WIN32 ) |
| 128 | wchar_t buf[MAX_UNICODE_PATH]; |
| 129 | if ( GetTempPathW( MAX_UNICODE_PATH, buf ) == 0 ) |
| 130 | return Path_GetWorkingDirectory(); |
| 131 | return UTF16to8( buf ); |
| 132 | #else |
| 133 | const char *pchTmpDir = getenv( "TMPDIR" ); |
| 134 | if ( pchTmpDir == NULL ) |
| 135 | { |
| 136 | return "/tmp"; |
| 137 | } |
| 138 | return pchTmpDir; |
| 139 | #endif |
| 140 | } |
| 141 | |
| 142 | /** Returns the specified path without its filename */ |
| 143 | std::string Path_StripFilename( const std::string & sPath, char slash ) |
nothing calls this directly
no test coverage detected