00001
00002
00003
00004
00005
00006 #ifndef H_CPPCommonException
00007 #define H_CPPCommonException
00008
00009 #include <typeinfo>
00010 #include <string>
00011 #include <memory.h>
00012 #include <cstdio>
00013 #include <C/Common/TRN_Exception.h>
00014
00015 namespace pdftron {
00016 namespace Common {
00017
00025 class Exception : public std::exception
00026 {
00027 public:
00028
00032 Exception(){};
00033
00034 Exception(TRN_Exception e);
00035
00045 Exception(const char* cond_expr,
00046 TRN_Int32 line_number,
00047 const char* file_name,
00048 const char* function,
00049 const char* message);
00050
00051 ~Exception() throw() {};
00052
00056 const char* GetCondExpr();
00057
00061 const char* GetFileName();
00062
00066 TRN_Int32 GetLineNumber();
00067
00071 const char* GetFunction();
00072
00076 const char* GetMessage();
00077
00081 std::string ToString();
00082
00086 std::ostream& Print(std::ostream& stream);
00087
00088 protected:
00089 TRN_Exception e;
00090
00091 };
00092
00093
00102 inline std::ostream& operator<<(std::ostream& stream, Exception& e)
00103 {
00104 return e.Print(stream);
00105 }
00106
00107
00108 #include <Impl/Exception.inl>
00109
00110 };
00111 };
00112
00113 #endif