charcoal/OpenGLEngine/Exception.h

23 lines
553 B
C
Raw Normal View History

#pragma once
#include <string>
// TODO: This MUST be changed to something less generic
#define EXCEPTION(message) Exception(message, __FILE__, __LINE__)
class Exception
{
public:
Exception(const std::string& message, const std::string& file_name, int line)
: m_message(message), m_file_name(file_name), m_line(line)
{}
const std::string& get_message() { return m_message; }
const std::string& get_file_name() { return m_file_name; }
int get_line() { return m_line; }
private:
std::string m_message;
std::string m_file_name;
int m_line;
};