Index: src/libchcore/TCoreException.cpp =================================================================== diff -u -N -r11b0a299be97bc3afaa633d6522c17b214ba3b79 -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 --- src/libchcore/TCoreException.cpp (.../TCoreException.cpp) (revision 11b0a299be97bc3afaa633d6522c17b214ba3b79) +++ src/libchcore/TCoreException.cpp (.../TCoreException.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) @@ -20,74 +20,73 @@ #include "TCoreException.h" #include -BEGIN_CHCORE_NAMESPACE - -// ============================================================================ -/// TCoreException::TCoreException -/// @date 2009/11/30 -/// -/// @brief Constructs core exception object with additional data. -/// @param[in] eErrorCode - error code -/// @param[in] pszFile - source file name -/// @param[in] stLineNumber - source line number -/// @param[in] pszFunction - function name in which the problem occured. -// ============================================================================ -TCoreException::TCoreException(EGeneralErrors eErrorCode, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : - TBaseException(eErrorCode, _T(""), pszFile, stLineNumber, pszFunction) +namespace chcore { -} + // ============================================================================ + /// TCoreException::TCoreException + /// @date 2009/11/30 + /// + /// @brief Constructs core exception object with additional data. + /// @param[in] eErrorCode - error code + /// @param[in] pszFile - source file name + /// @param[in] stLineNumber - source line number + /// @param[in] pszFunction - function name in which the problem occured. + // ============================================================================ + TCoreException::TCoreException(EGeneralErrors eErrorCode, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : + TBaseException(eErrorCode, _T(""), pszFile, stLineNumber, pszFunction) + { + } -// ============================================================================ -/// TCoreException::TCoreException -/// @date 2009/11/30 -/// -/// @brief Constructs core exception object with additional data. -/// @param[in] eErrorCode - error code -/// @param[in] stdException - standard exception info -/// @param[in] pszFile - source file name -/// @param[in] stLineNumber - source line number -/// @param[in] pszFunction - function name in which the problem occured. -// ============================================================================ -TCoreException::TCoreException(EGeneralErrors eErrorCode, std::exception& stdException, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : - TBaseException(eErrorCode, stdException.what(), pszFile, stLineNumber, pszFunction) -{ -} + // ============================================================================ + /// TCoreException::TCoreException + /// @date 2009/11/30 + /// + /// @brief Constructs core exception object with additional data. + /// @param[in] eErrorCode - error code + /// @param[in] stdException - standard exception info + /// @param[in] pszFile - source file name + /// @param[in] stLineNumber - source line number + /// @param[in] pszFunction - function name in which the problem occured. + // ============================================================================ + TCoreException::TCoreException(EGeneralErrors eErrorCode, std::exception& stdException, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : + TBaseException(eErrorCode, stdException.what(), pszFile, stLineNumber, pszFunction) + { + } -// ============================================================================ -/// TCoreWin32Exception::TCoreWin32Exception -/// @date 2011/07/18 -/// -/// @brief Constructs core win32 exception. -/// @param[in] eErrorCode - core error code -/// @param[in] dwWin32Exception - win32 error code -/// @param[in] pszFile -source file where the exception was thrown -/// @param[in] stLineNumber - source code line number where the exception was thrown -/// @param[in] pszFunction - function throwing the exception -// ============================================================================ -TCoreWin32Exception::TCoreWin32Exception(EGeneralErrors eErrorCode, DWORD dwWin32Exception, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : - TBaseException(eErrorCode, _T(""), pszFile, stLineNumber, pszFunction), - m_dwWin32ErrorCode(dwWin32Exception) -{ -} + // ============================================================================ + /// TCoreWin32Exception::TCoreWin32Exception + /// @date 2011/07/18 + /// + /// @brief Constructs core win32 exception. + /// @param[in] eErrorCode - core error code + /// @param[in] dwWin32Exception - win32 error code + /// @param[in] pszFile -source file where the exception was thrown + /// @param[in] stLineNumber - source code line number where the exception was thrown + /// @param[in] pszFunction - function throwing the exception + // ============================================================================ + TCoreWin32Exception::TCoreWin32Exception(EGeneralErrors eErrorCode, DWORD dwWin32Exception, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : + TBaseException(eErrorCode, _T(""), pszFile, stLineNumber, pszFunction), + m_dwWin32ErrorCode(dwWin32Exception) + { + } -// ============================================================================ -/// TCoreWin32Exception::GetErrorInfo -/// @date 2011/07/18 -/// -/// @brief Retrieves formatted exception information. -/// @param[in] pszBuffer - buffer for formatted string -/// @param[in] stMaxBuffer - max size of buffer -// ============================================================================ -void TCoreWin32Exception::GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const -{ - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("Error code: %ld (win32 error code: %lu)"), m_eErrorCode, m_dwWin32ErrorCode); - pszBuffer[stMaxBuffer - 1] = _T('\0'); -} + // ============================================================================ + /// TCoreWin32Exception::GetErrorInfo + /// @date 2011/07/18 + /// + /// @brief Retrieves formatted exception information. + /// @param[in] pszBuffer - buffer for formatted string + /// @param[in] stMaxBuffer - max size of buffer + // ============================================================================ + void TCoreWin32Exception::GetErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const + { + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("Error code: %ld (win32 error code: %lu)"), m_eErrorCode, m_dwWin32ErrorCode); + pszBuffer[stMaxBuffer - 1] = _T('\0'); + } -void TCoreWin32Exception::GetDetailedErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const -{ - _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("Error code: %ld\r\nWin32 error code: %lu\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), m_eErrorCode, m_dwWin32ErrorCode, m_pszFile, m_pszFunction, (unsigned long)m_stLineNumber); - pszBuffer[stMaxBuffer - 1] = _T('\0'); + void TCoreWin32Exception::GetDetailedErrorInfo(wchar_t* pszBuffer, size_t stMaxBuffer) const + { + _snwprintf_s(pszBuffer, stMaxBuffer, _TRUNCATE, _T("Error code: %ld\r\nWin32 error code: %lu\r\nFile: %s\r\nFunction: %s\r\nLine no: %lu"), m_eErrorCode, m_dwWin32ErrorCode, m_pszFile, m_pszFunction, (unsigned long)m_stLineNumber); + pszBuffer[stMaxBuffer - 1] = _T('\0'); + } } - -END_CHCORE_NAMESPACE