Initial ui test.
This commit is contained in:
parent
7fcc8e43ae
commit
36515556b8
15 changed files with 178 additions and 28 deletions
|
@ -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>();
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
|
||||
std::vector<std::string> getUserArgs() const;
|
||||
|
||||
static void initialize(CommandLineArgs* args);
|
||||
private:
|
||||
std::vector<std::string> mArugments;
|
||||
std::filesystem::path mLaunchPath;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue