MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / Path_GetTemporaryDirectory

Function Path_GetTemporaryDirectory

src/vrcore/pathtools_public.cpp:125–140  ·  view source on GitHub ↗

Gets the path to a temporary directory. */

Source from the content-addressed store, hash-verified

123
124/** Gets the path to a temporary directory. */
125std::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 */
143std::string Path_StripFilename( const std::string & sPath, char slash )

Callers

nothing calls this directly

Calls 2

Path_GetWorkingDirectoryFunction · 0.70
UTF16to8Function · 0.70

Tested by

no test coverage detected