Mercurial > hg > orthanc-stone
diff Platforms/Wasm/WasmPlatformApplicationAdapter.cpp @ 535:79bb0a02d1cc bgo-commands-codegen
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
- Last fixes to new style command handling (removed useless commands and switch command handling in simple samples to use XxxxSerializedMessageXxxx instead of XxxxCommandXxxx
- Fixed hardcoded input instance in SingleFrameEditorApplication
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 19 Mar 2019 09:13:57 +0100 |
parents | 7105a0bad250 |
children | 4fe4b221a31f |
line wrap: on
line diff
--- a/Platforms/Wasm/WasmPlatformApplicationAdapter.cpp Mon Mar 18 11:27:01 2019 +0100 +++ b/Platforms/Wasm/WasmPlatformApplicationAdapter.cpp Tue Mar 19 09:13:57 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