5#include "flutter/fml/command_line.h"
15 wchar_t* command_line = GetCommandLineW();
17 std::unique_ptr<
wchar_t*[],
decltype(::LocalFree)*> unicode_argv(
18 CommandLineToArgvW(command_line, &unicode_argc), ::LocalFree);
22 std::vector<std::string> utf8_argv;
23 for (
int i = 0;
i < unicode_argc; ++
i) {
24 wchar_t* arg = unicode_argv[
i];
25 int arg_len = WideCharToMultiByte(CP_UTF8, 0, arg, wcslen(arg),
nullptr, 0,
27 std::string utf8_arg(arg_len, 0);
28 WideCharToMultiByte(CP_UTF8, 0, arg, -1, utf8_arg.data(), utf8_arg.size(),
30 utf8_argv.push_back(std::move(utf8_arg));
std::optional< CommandLine > CommandLineFromPlatform()
CommandLine CommandLineFromIterators(InputIterator first, InputIterator last)