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