#include "CommandLineArgs.h" #include "UnicodeUtils.h" #include "Win32BaseIncludes.h" CommandLineArgs::CommandLineArgs() : mArugments(), mLaunchPath() { } void CommandLineArgs::initialize(CommandLineArgs* args) { #ifdef _WIN32 int nArgs{ 0 }; auto szArglist = ::CommandLineToArgvW(::GetCommandLineW(), &nArgs); if (szArglist == nullptr) { return; } std::vector windowsArgs(nArgs); for (int idx = 0; idx < nArgs; idx++) { windowsArgs[idx] = UnicodeUtils::utf16ToUtf8String(szArglist[idx]); } ::LocalFree(szArglist); args->process(windowsArgs); #else (void)args; #endif } Ptr CommandLineArgs::Create() { return Ptr::create(); } FileSystemPath CommandLineArgs::getLaunchPath() { return mLaunchPath; } void CommandLineArgs::recordLaunchPath() { mLaunchPath = FileSystemPath::current_dir(); } void CommandLineArgs::process(int argc, char *argv[]) { for(int idx=0; idx& args) { mArugments = args; } Vector CommandLineArgs::getUserArgs() const { Vector user_args; for(unsigned idx=1; idx CommandLineArgs::getArgs() const { return mArugments; }