SourceForge.net Logo

XQException.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2006
00003  *     DecisionSoft Limited. All rights reserved.
00004  * Copyright (c) 2004-2006
00005  *     Progress Software Corporation. All rights reserved.
00006  * Copyright (c) 2004-2006
00007  *     Oracle. All rights reserved.
00008  *
00009  * See the file LICENSE for redistribution information.
00010  *
00011  * $Id: XQException.hpp,v 1.11 2007/07/10 16:28:58 jpcs Exp $
00012  */
00013 
00014 #ifndef XQEXCEPTION_HPP
00015 #define XQEXCEPTION_HPP
00016 
00017 #include <xqilla/framework/XQillaExport.hpp>
00018 #include <xqilla/utils/XStr.hpp>
00019 
00020 #define XQThrow(type, function, reason) throw type(function, reason, this, __FILE__, __LINE__)
00021 #define XQThrow2(type, function, reason) throw type(function, reason, 0, __FILE__, __LINE__)
00022 #define XQThrow3(type, function, reason, location) throw type(function, reason, location, __FILE__, __LINE__)
00023 #define XQSimpleThrow(reason, xqfile, xqline, xqcolumn) throw XQException(reason, xqfile, xqline, (unsigned int)xqcolumn, __FILE__, __LINE__)
00024 
00025 class LocationInfo;
00026 
00027 class XQILLA_API XQException
00028 {
00029 public:
00030   XQException(const XMLCh *reason, const XMLCh* file, unsigned int line, unsigned int column, const char *cppFile, unsigned int cppLine);
00031   XQException(const XQException &);
00032   virtual ~XQException();
00033 
00034   const XMLCh *getType() const { return type_; }
00035   const XMLCh *getError() const { return error_; }
00036 
00037   const XMLCh *getXQueryFile() const { return xqFile_; }
00038   unsigned int getXQueryLine() const { return xqLine_; }
00039   unsigned int getXQueryColumn() const { return xqColumn_; }
00040 
00041   void setXQueryPosition(const XMLCh *file, unsigned int line, unsigned int column);
00042   void setXQueryPosition(const LocationInfo *info);
00043 
00044   const XMLCh *getCppFunction() const { return cppFunction_; }
00045   const char *getCppFile() const { return cppFile_; }
00046   unsigned int getCppLine() const { return cppLine_; }
00047 
00048   void printDebug(const XMLCh* const context) const;
00049 
00050 protected:
00051   XQException(const XMLCh* const type, const XMLCh* const functionName, const XMLCh* const reason, const LocationInfo *info, const char *cppFile, unsigned int cppLine);
00052 
00053 private:
00054   XQException &operator=(const XQException &);
00055   
00056   XMLCh* type_;
00057   XMLCh* error_;
00058 
00059   XMLCh* cppFunction_;
00060   const char *cppFile_;
00061   unsigned int cppLine_;
00062 
00063   unsigned int xqLine_, xqColumn_;
00064   XMLCh* xqFile_;
00065 };
00066 
00067 #endif
00068 

Generated on Fri Aug 31 14:37:35 2007 for XQilla Simple API by  doxygen 1.5.1