2 * FileNotFoundException.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 /* FileNotFoundException member functions implementation.
16 #include <FileNotFoundException.hpp>
28 FileNotFoundException::FileNotFoundException()
30 this->reason = (char*) calloc(strlen("File not found") + 1, sizeof(char));
31 strcpy(this->reason, "File not found");
35 FileNotFoundException::FileNotFoundException(const FileNotFoundException& rFileNotFoundException)
37 const char* reason = rFileNotFoundException.toString();
38 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
39 strcpy(this->reason, reason);
43 FileNotFoundException::FileNotFoundException(const char* file)
45 this->reason = (char*) calloc(strlen("File not found ") + strlen(file) + 1, sizeof(char));
46 sprintf(this->reason, "File not found %s", file);
50 FileNotFoundException::~FileNotFoundException()
56 const char* FileNotFoundException::toString(void) const
58 return (const char*)(this->reason);
62 const FileNotFoundException& FileNotFoundException::operator = (const FileNotFoundException& rFileNotFoundException)
64 const char* reason = rFileNotFoundException.toString();
65 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));