/src/ogre/OgreMain/src/OgreException.cpp
Line | Count | Source |
1 | | /* |
2 | | ----------------------------------------------------------------------------- |
3 | | This source file is part of OGRE |
4 | | (Object-oriented Graphics Rendering Engine) |
5 | | For the latest info, see http://www.ogre3d.org/ |
6 | | |
7 | | Copyright (c) 2000-2014 Torus Knot Software Ltd |
8 | | |
9 | | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | | of this software and associated documentation files (the "Software"), to deal |
11 | | in the Software without restriction, including without limitation the rights |
12 | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
13 | | copies of the Software, and to permit persons to whom the Software is |
14 | | furnished to do so, subject to the following conditions: |
15 | | |
16 | | The above copyright notice and this permission notice shall be included in |
17 | | all copies or substantial portions of the Software. |
18 | | |
19 | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | THE SOFTWARE. |
26 | | ----------------------------------------------------------------------------- |
27 | | */ |
28 | | #include "OgreStableHeaders.h" |
29 | | |
30 | | #ifdef __BORLANDC__ |
31 | | #include <stdio.h> |
32 | | #endif |
33 | | |
34 | | namespace Ogre { |
35 | | |
36 | | Exception::Exception(int num, const String& desc, const String& src) : |
37 | 0 | Exception(num, desc, src, "", "", 0) |
38 | 0 | { |
39 | 0 | } |
40 | | |
41 | | Exception::Exception(int num, const String& desc, const String& src, |
42 | | const char* typ, const char* fil, long lin) : |
43 | 256 | line( lin ), |
44 | 256 | typeName(typ), |
45 | 256 | description( desc ), |
46 | 256 | source( src ), |
47 | 256 | file( fil ) |
48 | 256 | { |
49 | 256 | StringStream ss; |
50 | | |
51 | 256 | ss << typeName << ": " |
52 | 256 | << description |
53 | 256 | << " in " << source; |
54 | | |
55 | 256 | if( line > 0 ) |
56 | 256 | { |
57 | 256 | ss << " at " << file << " (line " << line << ")"; |
58 | 256 | } |
59 | | |
60 | 256 | fullDesc = ss.str(); |
61 | 256 | } |
62 | | |
63 | | Exception::Exception(const Exception& rhs) |
64 | 256 | : line( rhs.line ), |
65 | 256 | typeName( rhs.typeName ), |
66 | 256 | description( rhs.description ), |
67 | 256 | source( rhs.source ), |
68 | 256 | file( rhs.file ) |
69 | 256 | { |
70 | 256 | } |
71 | | } |
72 | | |