MCPcopy Create free account
hub / github.com/KDAB/KDDockWidgets / GetCommandLineArguments

Function GetCommandLineArguments

examples/flutter/windows/runner/utils.cpp:32–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32std::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
53std::string Utf8FromUtf16(const wchar_t *utf16_string)
54{

Callers 1

wWinMainFunction · 0.70

Calls 1

Utf8FromUtf16Function · 0.70

Tested by

no test coverage detected