DCL 3.7.6
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 ScriptException SysError URISyntaxException XmlException

Public Member Functions

 Exception (Exception *_cause=NULL)
const Exception * cause () 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 * __cause

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 __cause;
53}
Exception * __cause
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 (__cause) {
77 __cause->destroy();
78// __cause = NULL;
79 }
81}
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 sb += p->className();
51#if __DCL_HAVE_ALLOC_DEBUG
52 char_t filename[100];
53 unsigned int line;
54 if (DCLDebugAllocGetPosition(p, filename,
55 __countof(filename, char_t), &line
56 )) {
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->__cause;
67 if (p)
68 sb += L"\n";
69 }
70
71 return sb;
72}
#define __countof(array, type)
Definition Config.h:340
wchar_t char_t
Definition Config.h:251
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:57

Member Data Documentation

◆ __cause

Exception* Exception::__cause
protected

Definition at line 29 of file Exception.h.


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