Mercurial > hg > orthanc-stone
changeset 672:86930bc676c6
fix
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 15 May 2019 18:54:55 +0200 |
parents | 28dca6cd827b |
children | 3f13f7f1b55d a285a0c0a720 |
files | Applications/Wasm/StartupParametersBuilder.cpp |
diffstat | 1 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/Wasm/StartupParametersBuilder.cpp Wed May 15 18:39:50 2019 +0200 +++ b/Applications/Wasm/StartupParametersBuilder.cpp Wed May 15 18:54:55 2019 +0200 @@ -1,9 +1,11 @@ #include "StartupParametersBuilder.h" #include <iostream> +#include <cstdio> +#include "emscripten/html5.h" namespace OrthancStone { - void StartupParametersBuilder::Clear() + void StartupParametersBuilder::Clear() { startupParameters_.clear(); } @@ -27,26 +29,27 @@ std::vector<const char*> argv(startupParameters_.size() + 1); int argCounter = 0; - argvStrings[argCounter] = "Toto.exe"; + argvStrings[argCounter] = "dummy.exe"; argv[argCounter] = argvStrings[argCounter].c_str(); argCounter++; - + std::string cmdLine = ""; for ( StartupParameters::const_iterator it = startupParameters_.begin(); it != startupParameters_.end(); it++) { - std::stringstream argSs; + std::stringstream argSs; - argSs << "--" << std::get<0>(*it); - if(std::get<1>(*it).length() > 0) - argSs << "=" << std::get<1>(*it); - - argvStrings[argCounter] = argSs.str(); - cmdLine = cmdLine + " " + argvStrings[argCounter]; - argv[argCounter] = argvStrings[argCounter].c_str(); - argCounter++; + argSs << "--" << std::get<0>(*it); + if(std::get<1>(*it).length() > 0) + argSs << "=" << std::get<1>(*it); + + argvStrings[argCounter] = argSs.str(); + cmdLine = cmdLine + " " + argvStrings[argCounter]; + std::cout << cmdLine << std::endl; + argv[argCounter] = argvStrings[argCounter].c_str(); + argCounter++; }