| 292 | |
| 293 | #ifdef _WIN32 |
| 294 | std::vector<std::string> GetUtf8CommandLineArgs() { |
| 295 | int argc = 0; |
| 296 | wchar_t** argv = CommandLineToArgvW(GetCommandLineW(), &argc); |
| 297 | std::vector<std::string> args; |
| 298 | if (argv == nullptr) { |
| 299 | return args; |
| 300 | } |
| 301 | args.reserve(static_cast<size_t>(argc)); |
| 302 | for (int i = 0; i < argc; i++) { |
| 303 | args.push_back(internal::Utf8FromWide(argv[i])); |
| 304 | } |
| 305 | LocalFree(argv); |
| 306 | return args; |
| 307 | } |
| 308 | #endif |
| 309 | |
| 310 | } // namespace tools |
no test coverage detected