DCL 4.0
Loading...
Searching...
No Matches
Exception Class Reference

#include <Exception.h>

Inheritance diagram for Exception:
Object AssertError CharsetConvertException GenerialException HttpFormDataDecoderException InvalidIndexException OutOfMemoryException ParseException RegexException SQLDriverException SQLException SSLException SysError URISyntaxException XmlException

Public Member Functions

 Exception (Exception *_cause=NULL)
const Exceptioncause () const
virtual String toString () const
String toStringAll () const
virtual void destroy ()
Public Member Functions inherited from Object
String className () const
bool isInstanceOf (const std::type_info &typeinfo) const
virtual const std::type_info & typeInfo () const

Protected Member Functions

virtual ~Exception ()
Protected Member Functions inherited from Object
virtual ~Object ()
 Object ()

Protected Attributes

Exception__pCause

Detailed Description

Definition at line 25 of file Exception.h.

Constructor & Destructor Documentation

◆ Exception()

Exception::Exception ( Exception * _cause = NULL)

◆ ~Exception()

virtual Exception::~Exception ( )
inlineprotectedvirtual

Definition at line 47 of file Exception.h.

47{} // cannot delete e, use e->destroy()

Member Function Documentation

◆ cause()

const Exception * Exception::cause ( ) const
inline

Definition at line 50 of file Exception.h.

51{
52 return __pCause;
53}
Exception * __pCause
Definition Exception.h:29

◆ destroy()

void Exception::destroy ( )
virtual

파생클래스에서 new 연산자를 override했거나, 추가적인 행위가 필요하다면 이것도 override하라

Reimplemented from Object.

Definition at line 74 of file Exception.cpp.

75{
76 if (__pCause)
77 {
78 __pCause->destroy();
79// __pCause = NULL;
80 }
82}
virtual void destroy()
Definition Object.cpp:192

◆ toString()

String Exception::toString ( ) const
virtual

Reimplemented from Object.

Reimplemented in AssertError, DllException, GenerialException, InvalidIndexException, IOException, ParseException, SQLDriverException, SQLException, SysError, and XmlException.

Definition at line 40 of file Exception.cpp.

41{
42 return String();
43}

◆ toStringAll()

String Exception::toStringAll ( ) const

Definition at line 45 of file Exception.cpp.

46{
47 StringBuilder sb;
48 const Exception* p = this;
49 while(p)
50 {
51 sb += p->className();
52#if __DCL_HAVE_ALLOC_DEBUG
53 char_t filename[100];
54 unsigned int line;
55 if (DCLDebugAllocGetPosition(p, filename,
56 __countof(filename, char_t), &line)) {
57 sb += L": ";
58 sb.append(filename);
59 sb += L":";
60 sb += UInteger::toString(line, 10);
61 }
62#endif
63 sb += L": ";
64 sb += p->toString();
65
66 p = p->__pCause;
67 if (p)
68 sb += L"\n";
69 }
70
71 return sb;
72}
#define __countof(array, type)
Definition Config.h:365
wchar_t char_t
Definition Config.h:275
virtual String toString() const
Definition Exception.cpp:40
Exception(Exception *_cause=NULL)
String className() const
Definition Object.cpp:163
String toString(unsigned _base=10) const
Definition Numeric.inl:54

Member Data Documentation

◆ __pCause

Exception* Exception::__pCause
protected

Definition at line 29 of file Exception.h.


The documentation for this class was generated from the following files: