35 #include "blocxx/BLOCXX_config.h"
44 namespace BLOCXX_NAMESPACE
55 FORMAT_MESSAGE_ALLOCATE_BUFFER
56 | FORMAT_MESSAGE_FROM_SYSTEM
57 | FORMAT_MESSAGE_IGNORE_INSERTS,
60 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
68 String rmsg((
const char*)lpMsgBuf);
71 ::LocalFree(lpMsgBuf);
78 DWORD errcode = GetLastError();
79 a_errorMessage.
format(
"%s%s%ld%s%s", a_action.
c_str(),
" failed with error ", errcode,
" : ",
errorMsg(errcode).
c_str());
87 DWORD errcode = (socketError) ? WSAGetLastError() : GetLastError();
93 return String(::strerror(errorCode));
int format(const char *fmt,...)
Format this string according to the given format and variable argument list (printf style) ...
This String class is an abstract data type that represents as NULL terminated string of characters...
String lastErrorMsg(bool socketError)
String errorMsg(int errorCode)
const char * c_str() const