Voxel
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Macros Pages
exception.cpp
Go to the documentation of this file.
1 /**
2  \file
3  \brief Contains Exception methods.
4 */
5 
6 
7 
8 
9 #include "exception.h"
10 #include "helpers.h"
11 
12 #include <sstream>
13 
14 
15 
16 
17 /*==============================================================================
18  Exception methods
19 ==============================================================================*/
20 
21 
22 Exception::Exception( char const* const file, unsigned int const line, std::string const& what ) {
23 
24  std::stringstream stream;
25  stream << file << " - line " << line << std::endl << '\t' << CollapseWhitespace( what );
26  m_what = stream.str();
27 }
28 
29 
30 Exception::Exception( char const* const file, unsigned int const line, std::string const& what, char const* const message ) {
31 
32  std::stringstream stream;
33  stream << file << " - line " << line << std::endl << '\t' << CollapseWhitespace( what ) << std::endl << '\t' << CollapseWhitespace( message );
34  m_what = stream.str();
35 }
36 
37 
38 Exception::~Exception() throw() {
39 }
40 
41 
42 const char* Exception::what() const throw() {
43 
44  return m_what.c_str();
45 }