FileNotFoundException Class Reference

This class is used to manage file ot found exception This exception is thrown when an attempt to open the file denoted by a specified pathname has failed. More...

#include <FileNotFoundException.h>

Inherits FileException.

Inheritance diagram for FileNotFoundException:

Inheritance graph
[legend]
Collaboration diagram for FileNotFoundException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FileNotFoundException () throw ()
 Default constructor.
 FileNotFoundException (std::string sNameOfTheFile, std::string sOrigin, std::string sFileName, unsigned int iLineNumber) throw ()
 This constructor requires 4 parameters :
  • the name of the file which cannot be opened
  • the method which throw the exception
  • the name of the file where the exception was thrown
  • the line number in the file where the exception was thrown ModelId=43834AC101D1.

virtual ~FileNotFoundException () throw ()
 Destructor.
virtual std::string makeDescription ()
 The description message provides by the file not found exception.
virtual std::string makeReason ()
 The reason message provides by the file not found exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the file not found exception.

Detailed Description

This class is used to manage file ot found exception This exception is thrown when an attempt to open the file denoted by a specified pathname has failed.

ModelId=43834AC101C1

Definition at line 20 of file FileNotFoundException.h.


Constructor & Destructor Documentation

FileNotFoundException::FileNotFoundException  )  throw ()
 

Default constructor.

Definition at line 16 of file FileNotFoundException.cpp.

00017 {
00018 
00019 }

FileNotFoundException::FileNotFoundException std::string  sNameOfTheFile,
std::string  sOrigin,
std::string  sFileName,
unsigned int  iLineNumber
throw ()
 

This constructor requires 4 parameters :

  • the name of the file which cannot be opened
  • the method which throw the exception
  • the name of the file where the exception was thrown
  • the line number in the file where the exception was thrown ModelId=43834AC101D1.

Definition at line 34 of file FileNotFoundException.cpp.

00035 {
00036         
00037         setNameOfTheFile(sNameOfTheFile);
00038 
00039         setLineNumber(iLineNumber);
00040         setFileName(sFileName);
00041         setType("FileNotFoundException");
00042         
00043         setDescription(makeDescription());
00044         setReason(makeReason());
00045         setOrigin(makeOrigin(sOrigin));
00046 }

FileNotFoundException::~FileNotFoundException  )  throw () [virtual]
 

Destructor.

Definition at line 23 of file FileNotFoundException.cpp.

00024 {
00025 
00026 }


Member Function Documentation

std::string FileNotFoundException::makeDescription  )  [virtual]
 

The description message provides by the file not found exception.

Implements FileException.

Definition at line 52 of file FileNotFoundException.cpp.

References FileException::getNameOfTheFile().

00053 {
00054         std::string     sExceptionMessage = "Can't open or read ";
00055                         sExceptionMessage+= "'";
00056                         sExceptionMessage+= getNameOfTheFile();
00057                         sExceptionMessage+= "'";
00058                         sExceptionMessage+= " file !!! ";
00059 
00060         return sExceptionMessage;
00061 }

Here is the call graph for this function:

std::string FileNotFoundException::makeOrigin std::string  sOrigin  )  [virtual]
 

The origin message provides by the file not found exception.

Implements FileException.

Definition at line 76 of file FileNotFoundException.cpp.

References Exception::getFileName(), Exception::getLineNumber(), and ltos().

00077 {
00078         std::string     sOriginMessage = getFileName();
00079                         sOriginMessage+= " (l:";
00080                         sOriginMessage+= ltos(getLineNumber());
00081                         sOriginMessage+= ") ";
00082                         sOriginMessage+= sOrigin;
00083                         
00084         return sOriginMessage;
00085 }

Here is the call graph for this function:

std::string FileNotFoundException::makeReason  )  [virtual]
 

The reason message provides by the file not found exception.

Implements FileException.

Definition at line 65 of file FileNotFoundException.cpp.

References Exception::getType().

00066 {
00067         std::string     sReasonMessage = "FILE_READ_ERROR --> ";
00068                         sReasonMessage+= getType();
00069                         
00070         return sReasonMessage;
00071 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri Jul 10 10:32:17 2009 for Utils Library by  doxygen 1.4.5