| 91 | |
| 92 | |
| 93 | static std::string |
| 94 | getUserName() |
| 95 | { |
| 96 | #ifdef __NATRON_WIN32__ |
| 97 | wchar_t user_name[UNLEN + 1]; |
| 98 | DWORD user_name_size = sizeof(user_name); |
| 99 | GetUserNameW(user_name, &user_name_size); |
| 100 | |
| 101 | std::wstring wUserName(user_name); |
| 102 | std::string sUserName = StrUtils::utf16_to_utf8(wUserName); |
| 103 | return sUserName; |
| 104 | #elif defined(__NATRON_UNIX__) |
| 105 | struct passwd *passwd; |
| 106 | passwd = getpwuid( getuid() ); |
| 107 | |
| 108 | return passwd->pw_name; |
| 109 | #endif |
| 110 | } |
| 111 | |
| 112 | static std::string |
| 113 | generateGUIUserName() |
no test coverage detected