Files

54 lines
1.3 KiB
C++

/**
* @file include/ActivMiddleware/ActivBase/OsException.h
*
* @brief Header file for the os dependant exception class
*
* Under Windows, OS exception encapsulates Windows error codes (see GetLastError()).
* Under Unix, the OS exception class is equivalent to CrtException.
*/
#if (!defined ACTIV_BASE_OS_EXCEPTION_H)
#define ACTIV_BASE_OS_EXCEPTION_H
#include "ActivMiddleware/ActivBase/Exception.h"
#if (!defined ACTIV_PLATFORM_WINDOWS)
#include "ActivMiddleware/ActivBase/CrtException.h"
//! Activ namespace.
namespace Activ
{
typedef CrtException OsException;
}
#else
//! Activ namespace.
namespace Activ
{
/**
* @brief OS exception class
*/
class OsException : public Exception
{
public:
/**
* @brief Default constructor.
*
* @param file the file which raised the exception.
* @param function the function which raised the exception.
* @param line the line number which raised the exception.
* @param errorCode the exception specific error code.
* @param message the exception message.
*/
ACTIV_BASE_API OsException(const char *file, const char *function, uint_fast32_t line, const uint_fast32_t errorCode,
const String &message = "");
ACTIV_BASE_API virtual String ToString() const ACTIV_OVERRIDE;
};
} // namespace Activ
#endif // (defined ACTIV_PLATFORM_WINDOWS)
#endif // (!defined ACTIV_BASE_OS_EXCEPTION_H)