Jun Furutani / libMiMic

Fork of libMiMic by Ryo Iizuka

Revision:
3:0a94993be1f6
Child:
7:2b33a8d84eb3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/ModMiMicSetting.cpp	Thu Apr 04 08:22:57 2013 +0000
@@ -0,0 +1,43 @@
+#include "ModMiMicSetting.h"
+#include "HttpdConnection.h"
+
+namespace MiMic
+{
+    ModMiMicSetting::ModMiMicSetting(const char* i_path)
+    {
+        this->setParam(i_path);
+    }
+    ModMiMicSetting::ModMiMicSetting()
+    {
+        this->_path=NULL;
+    }
+    ModMiMicSetting::~ModMiMicSetting()
+    {
+        if(this->_path!=NULL){
+            free(this->_path);
+        }
+    }
+    void ModMiMicSetting::setParam(const char* i_path)
+    {
+        this->_path=(char*)malloc(strlen(i_path)+1);
+        strcpy(this->_path,i_path);
+    }
+    bool ModMiMicSetting::execute(HttpdConnection& i_connection)
+    {
+        NyLPC_TcModMiMicSetting_t mod;
+
+        //check parametor
+        if(this->_path==NULL){
+            return false;
+        }
+        NyLPC_cModMiMicSetting_initialize(&mod,this->_path);
+        if(NyLPC_cModMiMicSetting_canHandle(&mod,i_connection._ref_inst)){
+            NyLPC_cModMiMicSetting_execute(&mod,i_connection._ref_inst);
+            NyLPC_cModMiMicSetting_finalize(&mod);
+            return true;
+        }
+        NyLPC_cModMiMicSetting_finalize(&mod);
+        return false;
+    }
+
+}
\ No newline at end of file