1 #include "HostNotFoundException.hpp"
\r
14 HostNotFoundException::HostNotFoundException()
\r
16 this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char));
\r
17 strcpy(this->reason, "Host not found : unknown");
\r
21 HostNotFoundException::HostNotFoundException(const HostNotFoundException& rHostNotFoundException)
\r
23 const char* reason = rHostNotFoundException.toString();
\r
24 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
25 strcpy(this->reason, reason);
\r
30 HostNotFoundException::HostNotFoundException(const char* name)
\r
32 this->reason = (char*) calloc(strlen("Host not found : ") + strlen(name) + 1, sizeof(char));
\r
33 sprintf(this->reason, "Host not found : %s", name);
\r
37 HostNotFoundException::~HostNotFoundException()
\r
43 const char* HostNotFoundException::toString(void) const
\r
45 return (const char*)(this->reason);
\r
49 const HostNotFoundException& HostNotFoundException::operator = (const HostNotFoundException& rHostNotFoundException)
\r
51 const char* reason = rHostNotFoundException.toString();
\r
52 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
59 }// namespace SimGrid
\r