diff Applications/Commands/BaseCommandBuilder.cpp @ 319:daa04d15192c am-2

new SimpleViewer sample that has been split in multiple files to be able to scale it
author am@osimis.io
date Thu, 11 Oct 2018 13:16:54 +0200
parents be2660b6e40a
children b70e9be013e4
line wrap: on
line diff
--- a/Applications/Commands/BaseCommandBuilder.cpp	Mon Oct 08 17:10:08 2018 +0200
+++ b/Applications/Commands/BaseCommandBuilder.cpp	Thu Oct 11 13:16:54 2018 +0200
@@ -32,32 +32,18 @@
       throw StoneException(ErrorCode_CommandJsonInvalidFormat);
     }
 
-    if (commandJson["commandType"].isString() && commandJson["commandType"].asString() == "simple")
+    if (commandJson["commandType"].isString() && commandJson["commandType"].asString() == "generic-no-arg-command")
     {
         printf("creating a simple command\n");
-        return new SimpleCommand(commandJson["command"].asString().c_str());
+        return new GenericNoArgCommand(commandJson["command"].asString().c_str());
+    }
+    else if (commandJson["commandType"].isString() && commandJson["commandType"].asString() == "generic-one-string-arg-command")
+    {
+        printf("creating a simple command\n");
+        return new GenericNoArgCommand(commandJson["command"].asString().c_str());
     }
 
     return NULL;
-    // std::string commandName = commandJson["command"].asString();
-
-
-
-
-    // CommandCreationFunctions::const_iterator it = commands_.find(commandName);
-    // if (it == commands_.end())
-    // {
-    //   throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource);  // TODO: use StoneException ?
-    // }
-
-    // // call the CreateCommandFn to build the command
-    // ICommand* command = it->second();
-    // if (commandJson["args"].isObject())
-    // {
-    //   command->Configure(commandJson["args"]);
-    // }
-
-    // return command;
   }
 
 }