ParseException Class Reference

This class is used to manage an exception during the parsing of a file or a buffer. More...

#include <ParseException.h>

Inherits FileException.

Inheritance diagram for ParseException:

Inheritance graph
[legend]
Collaboration diagram for ParseException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ParseException () throw ()
 Default constructor.
 ParseException (std::string sElementName) throw ()
 This constructor requires 1 parameter :
  • the name of the null pointer element ModelId=43834ABF00BB.

 ParseException (std::string sElementName, std::string sOrigin, std::string sFileName, unsigned int iLineNumber) throw ()
 This constructor requires 4 parameters :
  • the name of the file or the buffer which can't be parsed
  • 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.

virtual ~ParseException () throw ()
 Destructor.
virtual std::string makeDescription ()
 The message provides by the parse exception.
virtual std::string makeReason ()
 The reason message provides by the parse exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the parse exception.

Private Attributes

std::string _sElementName

Detailed Description

This class is used to manage an exception during the parsing of a file or a buffer.

Definition at line 19 of file ParseException.h.


Constructor & Destructor Documentation

ParseException::ParseException  )  throw ()
 

Default constructor.

Definition at line 16 of file ParseException.cpp.

00017 {
00018 
00019 }

ParseException::ParseException std::string  sElementName  )  throw ()
 

This constructor requires 1 parameter :

  • the name of the null pointer element ModelId=43834ABF00BB.

Definition at line 31 of file ParseException.cpp.

00031                                                               : _sElementName(sElementName)
00032 {       
00033         setType("NullPointerException");
00034         setLineNumber(0);
00035         setFileName("");
00036         
00037         setDescription(makeDescription());
00038         setReason(makeReason());
00039         setOrigin("");
00040 
00041 }

ParseException::ParseException std::string  sElementName,
std::string  sOrigin,
std::string  sFileName,
unsigned int  iLineNumber
throw ()
 

This constructor requires 4 parameters :

  • the name of the file or the buffer which can't be parsed
  • 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=43834ABF00BD

Definition at line 49 of file ParseException.cpp.

00049                                                                                                                             : _sElementName(sElementName)
00050 {       
00051         setType("ParseException");
00052         setLineNumber(iLineNumber);
00053         setFileName(sFileName);
00054         
00055         setDescription(makeDescription());
00056         setReason(makeReason());
00057         setOrigin(makeOrigin(sOrigin));
00058 }

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

Destructor.

Definition at line 22 of file ParseException.cpp.

00023 {
00024 
00025 }


Member Function Documentation

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

The message provides by the parse exception.

Implements FileException.

Definition at line 63 of file ParseException.cpp.

References _sElementName.

00064 {
00065         std::string     sExceptionMessage = "The parsing of ";
00066                         sExceptionMessage+= _sElementName;
00067                         sExceptionMessage+= " encountered an problem !!!";
00068         return sExceptionMessage;
00069 }

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

The origin message provides by the parse exception.

Implements FileException.

Definition at line 84 of file ParseException.cpp.

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

00085 {
00086         std::string     sOriginMessage = getFileName();
00087                         sOriginMessage+= " (l:";
00088                         sOriginMessage+= ltos(getLineNumber());
00089                         sOriginMessage+= ") ";
00090                         sOriginMessage+= sOrigin;
00091                         
00092         return sOriginMessage;
00093 }

Here is the call graph for this function:

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

The reason message provides by the parse exception.

Implements FileException.

Definition at line 74 of file ParseException.cpp.

References Exception::getType().

00075 {
00076         std::string     sReasonMessage = "FILE_READ_ERROR --> ";
00077                         sReasonMessage+= getType();
00078                         
00079         return sReasonMessage;
00080 }

Here is the call graph for this function:


Member Data Documentation

std::string ParseException::_sElementName [private]
 

Definition at line 40 of file ParseException.h.

Referenced by makeDescription().


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