2 * ProcessNotFoundException.cxx
4 * Copyright 2006,2007 Martin Quinson, Malek Cherier
7 * This program is free software; you can redistribute
8 * it and/or modify it under the terms of the license
9 *(GNU LGPL) which comes with this package.
13 /* ProcessNotFoundException member functions implementation.
16 #include <ProcessNotFoundException.hpp>
27 ProcessNotFoundException::ProcessNotFoundException()
29 this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char));
30 strcpy(this->reason, "Host not found : unknown");
34 ProcessNotFoundException::ProcessNotFoundException(const ProcessNotFoundException& rProcessNotFoundException)
36 const char* reason = rProcessNotFoundException.toString();
37 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
38 strcpy(this->reason, reason);
43 ProcessNotFoundException::ProcessNotFoundException(int PID)
49 sprintf(buff,"%d",PID);
51 this->reason = (char*) calloc(strlen("Process not found : ") + strlen(buff) + 1, sizeof(char));
52 sprintf(this->reason, "Host not found : %s", buff);
56 ProcessNotFoundException::~ProcessNotFoundException()
62 const char* ProcessNotFoundException::toString(void) const
64 return (const char*)(this->reason);
68 const ProcessNotFoundException& ProcessNotFoundException::operator = (const ProcessNotFoundException& rProcessNotFoundException)
70 const char* reason = rProcessNotFoundException.toString();
71 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));