mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-21 06:37:42 +01:00
added Error::last()
This commit is contained in:
parent
781acfa0bd
commit
8769ef01bc
@ -33,9 +33,15 @@ class Foundation_API Error
|
||||
public:
|
||||
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
static DWORD last();
|
||||
/// Utility function returning the last error.
|
||||
|
||||
static std::string getMessage(DWORD errorCode);
|
||||
/// Utility function translating numeric error code to string.
|
||||
#else
|
||||
static int last();
|
||||
/// Utility function returning the last error.
|
||||
|
||||
static std::string getMessage(int errorCode);
|
||||
/// Utility function translating numeric error code to string.
|
||||
#endif
|
||||
|
@ -19,12 +19,18 @@
|
||||
#include "Poco/Error.h"
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
DWORD Error::last()
|
||||
{
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
|
||||
std::string Error::getMessage(DWORD errorCode)
|
||||
{
|
||||
@ -44,6 +50,11 @@ namespace Poco {
|
||||
}
|
||||
|
||||
#else
|
||||
int Error::last()
|
||||
{
|
||||
return errno;
|
||||
}
|
||||
|
||||
|
||||
std::string Error::getMessage(int errorCode)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user