MCPcopy Create free account
hub / github.com/DevsOnFlutter/draggable_home / GetCommandLineArguments

Function GetCommandLineArguments

example/windows/runner/utils.cpp:24–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24std::vector<std::string> GetCommandLineArguments() {
25 // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 int argc;
27 wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 if (argv == nullptr) {
29 return std::vector<std::string>();
30 }
31
32 std::vector<std::string> command_line_arguments;
33
34 // Skip the first argument as it's the binary name.
35 for (int i = 1; i < argc; i++) {
36 command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 }
38
39 ::LocalFree(argv);
40
41 return command_line_arguments;
42}
43
44std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 if (utf16_string == nullptr) {

Callers 1

wWinMainFunction · 0.85

Calls 1

Utf8FromUtf16Function · 0.85

Tested by

no test coverage detected