| 836 | } |
| 837 | |
| 838 | std::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 | |
| 871 | int Sys::getCPUCount() { |
| 872 | int nprocs = -1; |
nothing calls this directly
no test coverage detected