Mercurial > hg > orthanc-stone
view Applications/Wasm/BasicWasmApplication.cpp @ 232:7d3b2c4f9ba1 am
don't cache hasUpdate_ since its not updated when we update the underlying hierarchy (i.e: when the child of a layout is a layout without child when it is added but childs are added later ...)
author | am@osimis.io |
---|---|
date | Fri, 15 Jun 2018 11:23:04 +0200 |
parents | 84844649a8fd |
children |
line wrap: on
line source
#include "BasicWasmApplication.h" namespace OrthancStone { void BasicWasmApplication::SetStartupParameter(const char* name, const char* value) { startupParameters_.push_back(std::make_tuple(name, value)); } void BasicWasmApplication::GetStartupParameters(boost::program_options::variables_map& parameters) { boost::program_options::options_description options; DeclareStartupOptions(options); const char* argv[startupParameters_.size() + 1]; int argCounter = 0; argv[0] = "Toto.exe"; argCounter++; std::string cmdLine = ""; for (StartupParameters::const_iterator it = startupParameters_.begin(); it != startupParameters_.end(); it++) { char* arg = new char[128]; snprintf(arg, 128, "--%s=%s", std::get<0>(*it).c_str(), std::get<1>(*it).c_str()); argv[argCounter] = arg; cmdLine = cmdLine + " --" + std::get<0>(*it) + "=" + std::get<1>(*it); argCounter++; } printf("simulated cmdLine = %s\n", cmdLine.c_str()); try { boost::program_options::store(boost::program_options::command_line_parser(argCounter, argv). options(options).run(), parameters); boost::program_options::notify(parameters); } catch (boost::program_options::error& e) { printf("Error while parsing the command-line arguments: %s\n", e.what()); } } }