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

Function Path_SetWorkingDirectory

samples/shared/pathtools.cpp:89–99  ·  view source on GitHub ↗

Sets the path of the current working directory. Returns true if this was successful. */

Source from the content-addressed store, hash-verified

87
88/** Sets the path of the current working directory. Returns true if this was successful. */
89bool Path_SetWorkingDirectory( const std::string & sPath )
90{
91 bool bSuccess;
92#if defined( _WIN32 )
93 std::wstring wsPath = UTF8to16( sPath.c_str() );
94 bSuccess = 0 == _wchdir( wsPath.c_str() );
95#else
96 bSuccess = 0 == chdir( sPath.c_str() );
97#endif
98 return bSuccess;
99}
100
101/** Returns the specified path without its filename */
102std::string Path_StripFilename( const std::string & sPath, char slash )

Callers

nothing calls this directly

Calls 1

UTF8to16Function · 0.70

Tested by

no test coverage detected