MCPcopy Create free account
hub / github.com/SpartanJ/eepp / getTempPath

Method getTempPath

src/eepp/system/sys.cpp:838–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836}
837
838std::string Sys::getTempPath() {
839 char path[EE_MAX_CFG_PATH_LEN + 1];
840
841#if EE_PLATFORM == EE_PLATFORM_WIN
842 DWORD dwRetVal = GetTempPathA( EE_MAX_CFG_PATH_LEN, path );
843
844 if ( dwRetVal == 0 || dwRetVal > EE_MAX_CFG_PATH_LEN ) {
845 return std::string( "C:\\WINDOWS\\TEMP\\" );
846 }
847#elif EE_PLATFORM == EE_PLATFORM_ANDROID
848 String::strCopy(
849 path,
850 std::string( Window::Engine::instance()->getPlatformHelper()->getInternalStoragePath() +
851 "/tmp/" )
852 .c_str(),
853 EE_MAX_CFG_PATH_LEN );
854#else
855 char* tmpdir = getenv( "TMPDIR" );
856
857 if ( NULL != tmpdir ) {
858 String::strCopy( path, tmpdir, EE_MAX_CFG_PATH_LEN );
859 } else {
860 String::strCopy( path, "/tmp", EE_MAX_CFG_PATH_LEN );
861 }
862#endif
863
864 std::string rpath( path );
865
866 FileSystem::dirAddSlashAtEnd( rpath );
867
868 return rpath;
869}
870
871int Sys::getCPUCount() {
872 int nprocs = -1;

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
getPlatformHelperMethod · 0.80

Tested by

no test coverage detected