00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef BEXCEPTION_H
00013 #define BEXCEPTION_H
00014
00015
00016 #include <string>
00017
00018
00019 #include "BStringUtils.h"
00020
00021 class BException {
00022 public:
00023 BException(const std::string& file, int line, const std::string& txt);
00024 std::string description(bool msgonly = false);
00025 protected:
00026 BException() {}
00027 std::string file;
00028 int line;
00029 std::string text;
00030 };
00031
00032 class BSystemException: public BException {
00033 public:
00034 BSystemException(const std::string& file, int line, const std::string& txt);
00035 };
00036
00037 #define BTHROW(cls, text, ...) throw cls(__FILE__, __LINE__, format(text))
00038
00039 #endif