Mercurial > hg > orthanc-stone
diff Platforms/Wasm/WasmPlatformApplicationAdapter.cpp @ 537:d785ee57bd95 dev
Merge from bgo-commands-codegen
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 19 Mar 2019 14:43:46 +0100 |
parents | 79bb0a02d1cc |
children | 4fe4b221a31f |
line wrap: on
line diff
--- a/Platforms/Wasm/WasmPlatformApplicationAdapter.cpp Mon Mar 18 16:01:07 2019 +0100 +++ b/Platforms/Wasm/WasmPlatformApplicationAdapter.cpp Tue Mar 19 14:43:46 2019 +0100 @@ -2,7 +2,6 @@ #include "Framework/Toolbox/MessagingToolbox.h" #include "Framework/StoneException.h" -#include <Applications/Commands/BaseCommandBuilder.h> #include <stdio.h> #include "Platforms/Wasm/Defaults.h" @@ -14,35 +13,6 @@ { } - void WasmPlatformApplicationAdapter::HandleCommandFromWeb(std::string& output, const std::string& input) - { - try - { - Json::Value inputJson; - // if the message is a command, build it and execute it - if (MessagingToolbox::ParseJson(inputJson, input.c_str(), input.size())) - { - std::unique_ptr<ICommand> command(application_.GetCommandBuilder().CreateFromJson(inputJson)); - if (command.get() == NULL) - printf("Could not parse command: '%s'\n", input.c_str()); - else - application_.ExecuteCommand(*command); - } - } - catch (StoneException& exc) - { - printf("Error while handling command from web (error code = %d):\n", exc.GetErrorCode()); - printf("While interpreting input: '%s'\n", input.c_str()); - output = std::string("ERROR : "); - } - catch (std::exception& exc) - { - printf("Error while handling message from web (error text = %s):\n", exc.what()); - printf("While interpreting input: '%s'\n", input.c_str()); - output = std::string("ERROR : "); - } - } - void WasmPlatformApplicationAdapter::HandleSerializedMessageFromWeb(std::string& output, const std::string& input) { try