12#if __DCL_HAVE_ALLOC_DEBUG
13#undef __DCL_ALLOC_LEVEL
14#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
33#if __DCL_HAVE_ALLOC_DEBUG
36 DCLDebugAllocSetCheckFlag(
this,
true);
52#if __DCL_HAVE_ALLOC_DEBUG
55 if (DCLDebugAllocGetPosition(p, filename,
86OutOfMemoryException::OutOfMemoryException()
100 __errorNo = _errorNo;
115 DWORD dwLength = ::FormatMessageW(
116 FORMAT_MESSAGE_ALLOCATE_BUFFER |
117 FORMAT_MESSAGE_FROM_SYSTEM |
118 FORMAT_MESSAGE_IGNORE_INSERTS,
121 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
129 for ( ; dwLength; dwLength--)
130 if (!(msg[dwLength - 1] == L
'\r' || msg[dwLength - 1] == L
'\n'))
133 sb.assign(msg, dwLength);
141 sb = L
"::FormatMessage Fail!";
151 CharBuffer*
buf = CharBuffer::create(256);
152 if (_wcserror_s(
buf->data(),
buf->__allocLength, __errorNo))
156 buf->__dataLength = String::length(
buf->data());
178 __message = L
"\"" + _name + L
"\"";
189 __message = L
"\"" + _name + L
"\"" +
__T(
" ") + _message;
206 __message = L
"invalid index key: " + _key;
212 __message = String::format(
213 L
"invalid index. valud: %d, valid range: %d <= valud <= %d",
230 __message = _message;
237 __message = _message;
238 __sourceOffset = _sourceOffset;
243 StringBuilder sb = __message;
244 if (__sourceOffset >= 0)
259NumericConvertException::NumericConvertException(
260 const String& _number,
266 __error = InvalidNumberString;
271NumericConvertException::NumericConvertException(
273 const String& _number,
278 __DCL_ASSERT(_error == Overflow || _error == Underflow);
286 if (__error == InvalidNumberString)
288 sb = L
"Invalid number string: \""
289 + ParseException::__message
298 if (ParseException::__sourceOffset >= 0)
310 if (__error == Overflow)
311 sb = L
"Numerical result overflow \"";
313 sb = L
"Numerical result underflow \"";
314 sb += ParseException::__message + L
"\"";
337 __message = pszErrorMessage;
342 StringBuilder sb = __message;
345 sb += L
": See! Detail";
363 __filename = _filename;
368 __message = _message;
373 return format(__filename, __line, __expr,
374 __message.isEmpty() ?
NULL : __message.data());
384 StringBuilder sb = L
"Assertion Failed ! '";
DCLCAPI int __strerror(String &_r, int _errnum)
#define __countof(array, type)
#define WINAPI_ERROR_MASK
#define __DCL_ASSERT(expr)
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
static String format(const char_t *_filename, unsigned int _line, const char_t *_expr, const char_t *_message)
AssertError(const char_t *_filename, unsigned int _line, const char_t *_expr, const char_t *_message)
virtual String toString() const
virtual String toString() const
Exception(Exception *_cause=NULL)
String toStringAll() const
GenerialException(Exception *_cause)
virtual String toString() const
virtual String toString() const
IOException(const String &_name, Exception *_cause)
String toString(unsigned _base=10) const
String toString(unsigned _base=10) const
InvalidIndexException(const String &_key)
virtual String toString() const
ParseException(const String &_message)
virtual String toString() const
virtual String toString() const
SysError(Exception *_cause=NULL)
String toString(unsigned _base=10) const
String toString(unsigned _base=10) const
String toString(unsigned _base=10) const