\r
#include <Environment.hpp>\r
\r
+#include <NullPointerException.hpp>\r
+#include <FileNotFoundException.hpp>\r
+#include <InvalidArgumentException.hpp>\r
+#include <LogicException.hpp>\r
+#include <MsgException.hpp>\r
+\r
+#include <stdlib.h>\r
+\r
#include <sys/types.h>\r
#include <sys/stat.h>\r
\r
+#include <msg/msg.h>\r
+\r
#ifndef S_ISREG\r
#define S_ISREG(__mode) (((__mode) & S_IFMT) == S_IFREG)\r
#endif\r
this->loaded = false;\r
}\r
\r
- Environment::Environment(const Environment& rEnvironment);\r
+ Environment::Environment(const Environment& rEnvironment)\r
{\r
this->file = rEnvironment.getFile();\r
this->loaded = rEnvironment.isLoaded();\r
}\r
\r
Environment::Environment(const char* file)\r
- throw(NullPointerException, InvalidArgumentException);\r
+ throw(NullPointerException, InvalidArgumentException)\r
{\r
// check parameters\r
\r
\r
struct stat statBuf = {0};\r
\r
- if(stat(statBuff, &info) < 0 || !S_ISREG(statBuff.st_mode))\r
- throw InvalidParameterException("file (file not found)");\r
+ if(stat(file, &statBuf) < 0 || !S_ISREG(statBuf.st_mode))\r
+ throw InvalidArgumentException("file (file not found)");\r
\r
this->file = file;\r
this->loaded = false;\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
MSG_create_environment(file);\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