KSquare Utilities
KKException.cpp
Go to the documentation of this file.
1 /* KKException.cpp -- Base class to be used for exception handling.
2  * Copyright (C) 1994-2014 Kurt Kramer
3  * For conditions of distribution and use, see copyright notice in KKB.h
4  */
5 #include "FirstIncludes.h"
6 #include <ctype.h>
7 #include <limits.h>
8 #include <math.h>
9 #include <stdio.h>
10 #include <iostream>
11 #include <memory>
12 #include <sstream>
13 #include <string>
14 #include <vector>
15 
16 #include "MemoryDebug.h"
17 using namespace std;
18 
19 
20 #include "KKException.h"
21 using namespace KKB;
22 
23 
24 
26  std::exception ()
27 {
28 }
29 
30 
31 KKException::KKException (const KKException& _exception):
32  std::exception (),
33  exceptionStr (_exception.exceptionStr)
34 {
35 }
36 
37 
38 KKException::KKException (const char* _exceptionStr):
39  std::exception (),
40  exceptionStr (_exceptionStr)
41 {
42 }
43 
44 
45 KKException::KKException (const KKStr& _exceptionStr):
46  std::exception (),
47  exceptionStr (_exceptionStr)
48 {
49 }
50 
51 
52 KKException::KKException (const KKStr& _exceptionStr,
53  const std::exception& _innerException
54  ):
55  std::exception (_innerException),
56  exceptionStr ()
57 {
58  exceptionStr << _exceptionStr << endl
59  << _innerException.what ();
60 }
61 
62 
63 
64 KKException::KKException (const char* _exceptionStr,
65  const std::exception& _innerException
66  )
67 {
68  exceptionStr << _exceptionStr << endl
69  << _innerException.what ();
70 }
71 
72 
73 
74 KKException::KKException (const char* _exceptionStr,
75  const KKException& _innerException
76  ):
77  std::exception (_innerException),
78  exceptionStr (_exceptionStr)
79 {
80 }
81 
82 
83 KKException::KKException (const KKStr& _exceptionStr,
84  const KKException& _innerException
85  ):
86  std::exception (_innerException),
87  exceptionStr (_exceptionStr)
88 {
89 }
90 
91 
92 
93 KKException::~KKException () throw ()
94 {
95 }
96 
97 
98 const KKStr& KKException::ToString () const
99 {
100  return exceptionStr;
101 }
102 
103 
104 const char* KKException::what () const throw ()
105 {
106  return exceptionStr.Str ();
107 }
KKException(const char *_exceptionStr, const KKException &_innerException)
Definition: KKException.cpp:74
virtual ~KKException()
Definition: KKException.cpp:93
KKException(const KKStr &_exceptionStr, const KKException &_innerException)
Definition: KKException.cpp:83
virtual const char * what() const
KKException(const char *_exceptionStr, const std::exception &_innerException)
Definition: KKException.cpp:64
KKException(const KKStr &_exceptionStr, const std::exception &_innerException)
Definition: KKException.cpp:52
KKTHread * KKTHreadPtr
KKStr(const KKStr &str)
Copy Constructor.
Definition: KKStr.cpp:561
KKException(const KKException &_exception)
Definition: KKException.cpp:31
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of &#39;std::string&#39; strings.
Definition: KKStr.cpp:1082
KKStr(const char *str)
Definition: KKStr.cpp:537
const char * Str() const
Returns a pointer to a ascii string.
Definition: KKStr.h:422
KKException(const char *_exceptionStr)
Definition: KKException.cpp:38
KKException(const KKStr &_exceptionStr)
Definition: KKException.cpp:45
virtual const KKStr & ToString() const
Definition: KKException.cpp:98