2 * ClassNotFoundException.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 /* ClassNotFoundException member functions implementation.
16 #include <ClassNotFoundException.hpp>
27 ClassNotFoundException::ClassNotFoundException()
29 this->reason = (char*) calloc(strlen("Class not found : unknown") + 1, sizeof(char));
30 strcpy(this->reason, "Class not found : unknown");
34 ClassNotFoundException::ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException)
36 const char* reason = rClassNotFoundException.toString();
37 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
38 strcpy(this->reason, reason);
43 ClassNotFoundException::ClassNotFoundException(const char* name)
45 this->reason = (char*) calloc(strlen("Class not found : ") + strlen(name) + 1, sizeof(char));
46 sprintf(this->reason, "Class not found : %s", name);
50 ClassNotFoundException::~ClassNotFoundException()
56 const char* ClassNotFoundException::toString(void) const
58 return (const char*)(this->reason);
62 const ClassNotFoundException& ClassNotFoundException::operator = (const ClassNotFoundException& rClassNotFoundException)
64 const char* reason = rClassNotFoundException.toString();
65 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));