warexception.h

来自「ftpserver very good sample」· C头文件 代码 · 共 123 行

H
123
字号
/** The WarLibrary's exception object. * * #include "WarException.h" <BR> * -llib  * * @doc Any exceptions thrown by the  * WarLibrary is of this type (or derievd * from this type).  *   * @see WarError */#ifndef WAR_EXCEPTION_H#define WAR_EXCEPTION_H/* SYSTEM INCLUDES */#ifndef WAR_EXCEPTION_INCLUDED#   define WAR_EXCEPTION_INCLUDED#   include <exception>#endif/* PROJECT INCLUDES */#ifndef WAR_ERROR_H#   include "WarError.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplusclass WarException : public std::exception,public WarError{public:    // LIFECYCLE        /**    * Default constructor.    */    WarException(const war_error_definitions local_error,             const int system_error = 0,             war_ccstr_t message = NULL,             war_ccstr_t source_file = __FILE__,             const int source_line = __LINE__);    /**    * Inherit WarError constructor.    */    WarException(const WarError& err,             war_ccstr_t message = NULL);    /** Copy constructor    */    WarException(const WarException& from);            /**    * Destructor.    */    virtual ~WarException() throw();        // OPERATORS    // OPERATIONS                           virtual const std::string& Explain() const;    virtual const char *what() const throw();    // ACCESS    // INQUIRY    protected:    std::string mMessage;private:};/* INLINE METHODS *//* EXTERNAL REFERENCES *////#define WarThrow(err, msg)\throw WarException(WarError(err.LocalError(), err.SystemError(), __FILE__, __LINE__), msg)#ifdef WIN32#   define WarThrowSyserr(msg) \    throw WarException(WarError(WAR_ERR_SYSTEM_ERROR, ::GetLastError(), __FILE__, __LINE__), msg)#else#   define WarThrowSyserr(msg) \    throw WarException(WarError(WAR_ERR_SYSTEM_ERROR, errno, __FILE__, __LINE__), msg)#endif#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif  /* _WAR_EXCEPTION_H_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?