Exception.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------------------
00002 // Copyright (c) 2001-2008 by PDFTron Systems Inc. All Rights Reserved.
00003 // Consult legal.txt regarding legal and license information.
00004 //---------------------------------------------------------------------------------------
00005 
00006 #ifndef   H_CPPCommonException
00007 #define   H_CPPCommonException
00008 
00009 #include <typeinfo>
00010 #include <string>
00011 #include <C/Common/TRN_Exception.h>
00012 
00013 namespace pdftron { 
00014         namespace Common {
00015 
00023 class Exception : public std::exception
00024 {
00025 public: 
00026 
00030          Exception(){};
00031 
00032          Exception(TRN_Exception e);
00033 
00043          Exception(const char* cond_expr,
00044                           long line_number, 
00045                           const char* file_name,
00046                           const char* function, 
00047                           const char* message);
00048 
00049          ~Exception() throw() {};
00050 
00054          const char* GetCondExpr();
00055 
00059          const char* GetFileName();
00060 
00064          long GetLineNumber();
00065         
00069          const char* GetFunction();
00070 
00074          const char* GetMessage();
00075 
00079          std::string ToString();
00080 
00084          std::ostream& Print(std::ostream& stream);
00085 
00086 protected:
00087         TRN_Exception e;
00088 
00089 };
00090 
00091 
00100 inline std::ostream& operator<<(std::ostream& stream, Exception& e) 
00101 {
00102         return e.Print(stream);
00103 }
00104 
00105 
00106 #include <Impl/Exception.inl>
00107 
00108         };      // namespace Common
00109 };      // namespace pdftron
00110 
00111 #endif

© 2002-2008 PDFTron Systems Inc.