2 * ClassNotFoundException.cxx
\r
4 * Copyright 2006,2007 Martin Quinson, Malek Cherier
\r
5 * All right reserved.
\r
7 * This program is free software; you can redistribute
\r
8 * it and/or modify it under the terms of the license
\r
9 *(GNU LGPL) which comes with this package.
\r
13 /* ClassNotFoundException member functions implementation.
\r
16 #include <ClassNotFoundException.hpp>
\r
27 ClassNotFoundException::ClassNotFoundException()
\r
29 this->reason = (char*) calloc(strlen("Class not found : unknown") + 1, sizeof(char));
\r
30 strcpy(this->reason, "Class not found : unknown");
\r
34 ClassNotFoundException::ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException)
\r
36 const char* reason = rClassNotFoundException.toString();
\r
37 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
38 strcpy(this->reason, reason);
\r
43 ClassNotFoundException::ClassNotFoundException(const char* name)
\r
45 this->reason = (char*) calloc(strlen("Class not found : ") + strlen(name) + 1, sizeof(char));
\r
46 sprintf(this->reason, "Class not found : %s", name);
\r
50 ClassNotFoundException::~ClassNotFoundException()
\r
56 const char* ClassNotFoundException::toString(void) const
\r
58 return (const char*)(this->reason);
\r
62 const ClassNotFoundException& ClassNotFoundException::operator = (const ClassNotFoundException& rClassNotFoundException)
\r
64 const char* reason = rClassNotFoundException.toString();
\r
65 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
72 }// namespace SimGrid
\r