Initial ui test.

This commit is contained in:
jmsgrogan 2023-01-05 13:16:52 +00:00
parent 7fcc8e43ae
commit 36515556b8
15 changed files with 178 additions and 28 deletions

View file

@ -1,5 +1,10 @@
#include "CommandLineArgs.h"
#include "StringUtils.h"
#ifdef _WIN32
#include "Windows.h"
#endif
CommandLineArgs::CommandLineArgs()
: mArugments(),
mLaunchPath()
@ -7,6 +12,27 @@ CommandLineArgs::CommandLineArgs()
}
void CommandLineArgs::initialize(CommandLineArgs* args)
{
#ifdef _WIN32
int nArgs{ 0 };
auto szArglist = ::CommandLineToArgvW(::GetCommandLineW(), &nArgs);
if (szArglist == nullptr)
{
return;
}
std::vector<std::string> windowsArgs(nArgs);
for (int idx = 0; idx < nArgs; idx++)
{
windowsArgs[idx] = StringUtils::convert(szArglist[idx]);
}
::LocalFree(szArglist);
args->process(windowsArgs);
#endif
}
std::unique_ptr<CommandLineArgs> CommandLineArgs::Create()
{
return std::make_unique<CommandLineArgs>();