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

Function Path_GetExecutableName

src/vrcore/pathtools_public.cpp:76–95  ·  view source on GitHub ↗

Returns the filename (excluding directory and extension) of the current executable */

Source from the content-addressed store, hash-verified

74
75/** Returns the filename (excluding directory and extension) of the current executable */
76std::string Path_GetExecutableName()
77{
78 std::string sExeFilename = Path_StripExtension( Path_StripDirectory( Path_GetExecutablePath() ) );
79#if defined( ANDROID )
80 // We determine the App ID by looking at `/proc/self/cmdline`, as Zygote changes our process name to match.
81 FILE *pCmdlineFile = fopen( "/proc/self/cmdline", "r" );
82 if ( pCmdlineFile != NULL )
83 {
84 // Google Play says the maximum allowable length is 150 characters
85 char rgchAndroidAppID[ 151 ] = { 0 };
86 fgets( rgchAndroidAppID, sizeof( rgchAndroidAppID ), pCmdlineFile );
87 fclose( pCmdlineFile );
88 if ( rgchAndroidAppID[ 0 ] != '\0' )
89 {
90 sExeFilename = rgchAndroidAppID;
91 }
92 }
93#endif
94 return sExeFilename;
95}
96
97/** Returns the path of the current working directory */
98std::string Path_GetWorkingDirectory()

Callers

nothing calls this directly

Calls 3

Path_StripExtensionFunction · 0.70
Path_StripDirectoryFunction · 0.70
Path_GetExecutablePathFunction · 0.70

Tested by

no test coverage detected