summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertionexception.h
blob: 77890a7ee98d83a2e1c91cca0654b46c8cdd7edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//          Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

#ifndef IGLOO_ASSERTIONEXCEPTION_H
#define IGLOO_ASSERTIONEXCEPTION_H

namespace snowhouse {
  class AssertionException : public std::exception
  {
    public:  
      AssertionException(const std::string& message)
        : m_message(message), m_fileName(""), m_line(0)
      {}

      AssertionException(const std::string& message, const std::string& fileName, unsigned int line)
        : m_message(message), m_fileName(fileName), m_line(line)
      {}

      virtual ~AssertionException() throw()
      {
      }

      std::string GetMessage() const
      {
        return m_message;
      }

      std::string GetFilename() const
      {
        return m_fileName;
      }

      unsigned int GetLineNumber() const
      {
        return m_line;
      }

    private:
      std::string m_message;  
      std::string m_fileName;
      unsigned int m_line;
  };
}

#endif // IGLOO_ASSERTIONEXCEPTION_H