| 30 | } |
| 31 | |
| 32 | std::vector<std::string> GetCommandLineArguments() |
| 33 | { |
| 34 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. |
| 35 | int argc; |
| 36 | wchar_t **argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); |
| 37 | if (argv == nullptr) { |
| 38 | return std::vector<std::string>(); |
| 39 | } |
| 40 | |
| 41 | std::vector<std::string> command_line_arguments; |
| 42 | |
| 43 | // Skip the first argument as it's the binary name. |
| 44 | for (int i = 1; i < argc; i++) { |
| 45 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); |
| 46 | } |
| 47 | |
| 48 | ::LocalFree(argv); |
| 49 | |
| 50 | return command_line_arguments; |
| 51 | } |
| 52 | |
| 53 | std::string Utf8FromUtf16(const wchar_t *utf16_string) |
| 54 | { |
no test coverage detected