*/ \r
\r
#include <Application.hpp>\r
+\r
+\r
+#include <NullPointerException.hpp>\r
+#include <FileNotFoundException.hpp>\r
+#include <LogicException.hpp>\r
+#include <MsgException.hpp>\r
#include <ApplicationHandler.hpp>\r
\r
#include <sys/types.h>\r
#include <sys/stat.h>\r
+#include <stdlib.h>\r
+\r
+#include <surf/surfxml_parse.h>\r
\r
#ifndef S_ISREG\r
#define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG)\r
this->deployed = false;\r
}\r
\r
- Application(const Application& rApplication)\r
+ Application::Application(const Application& rApplication)\r
{\r
\r
this->file = rApplication.getFile();\r
\r
struct stat statBuf = {0};\r
\r
- if(stat(statBuff, &info) < 0 || !S_ISREG(statBuff.st_mode))\r
+ if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
throw FileNotFoundException(file);\r
\r
this->file = file;\r
// NOTHING TODO\r
}\r
\r
- Application::deploy(const char* file)\r
+ void Application::deploy(const char* file)\r
throw(NullPointerException, FileNotFoundException, LogicException, MsgException)\r
{\r
// check logic\r
\r
struct stat statBuf = {0};\r
\r
- if(stat(statBuff, &info) < 0 || !S_ISREG(statBuff.st_mode))\r
+ if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
throw FileNotFoundException(file);\r
\r
surf_parse_reset_parser();\r
surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess);\r
\r
// set the process arg handler\r
- surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onArg);\r
+ surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg);\r
\r
// set the properties handler\r
surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty);\r
\r
// set the end of the xml process element handler\r
- surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::OnEndProcess);\r
+ surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess);\r
\r
surf_parse_open(file);\r
\r
this->deployed = true;\r
}\r
\r
- Application::deploy(void)\r
+ void Application::deploy(void)\r
throw(LogicException, MsgException)\r
{\r
// check logic\r
\r
surf_parse_reset_parser();\r
surfxml_add_callback(STag_surfxml_process_cb_list, ApplicationHandler::onBeginProcess);\r
- surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onArg);\r
+ surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg);\r
surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty);\r
- surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::OnEndProcess);\r
+ surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess);\r
\r
surf_parse_open(file);\r
\r
this->deployed = true; \r
}\r
\r
- bool Application::isDeployed(void)\r
+ bool Application::isDeployed(void) const\r
{\r
return this->deployed;\r
}\r
\r
struct stat statBuf = {0};\r
\r
- if(stat(statBuff, &info) < 0 || !S_ISREG(statBuff.st_mode))\r
+ if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
throw FileNotFoundException("file (file not found)");\r
\r
this->file = file;\r