OSDN Git Service

2012/01/29 23:52:34
[nlite/nlite.git] / nlib / nlib_exception.cpp
1 #include "StdAfx.h"
2 #include "nlib_include.h"
3
4
5 namespace nlib{
6
7
8 Exception::Exception(){}
9
10 Exception::Exception(const char* const& errMessage):exception(errMessage){}
11
12 Exception::Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function):
13         wErrMessage(errMessage),
14         line(in_line),
15         function(in_function)
16 {
17         WCHAR file[_MAX_FNAME];
18         WCHAR ext[_MAX_EXT];
19         _wsplitpath(in_fileName,(wchar_t*)NULL,(wchar_t*)NULL,file,ext);
20         fileName = file;
21         fileName += ext;
22
23 }
24
25 LPCTSTR Exception::what(){
26
27         return wErrMessage.c_str();
28
29 }
30
31 UINT_PTR Exception::getLineNo(){
32
33         return line;
34 }
35
36 LPCTSTR Exception::getFileName(){
37                         
38         return fileName.c_str();
39                 
40 }
41
42 LPCTSTR Exception::getFunctionName(){
43
44         return function.c_str();
45 }
46
47
48
49
50
51
52 }