aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/je_exception.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-18 23:44:40 +0800
committerchai <chaifix@163.com>2018-11-18 23:44:40 +0800
commit8cb74178c2b8e5883a1181af687fa8cfc0c6e5da (patch)
treef56c536a029148df35bd4e82034a9b563a2381df /src/libjin/Common/je_exception.cpp
parentf0f340dec7821cee103ab9267ef941a917ef4dc4 (diff)
*修改目录为小写
Diffstat (limited to 'src/libjin/Common/je_exception.cpp')
-rw-r--r--src/libjin/Common/je_exception.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/libjin/Common/je_exception.cpp b/src/libjin/Common/je_exception.cpp
deleted file mode 100644
index 5489a42..0000000
--- a/src/libjin/Common/je_exception.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <stdarg.h>
-
-#include "je_exception.h"
-
-namespace JinEngine
-{
-
- Exception::Exception(const char *fmt, ...)
- {
- va_list args;
- int size_buffer = 256, size_out;
- char *buffer;
- while (true)
- {
- buffer = new char[size_buffer];
- memset(buffer, 0, size_buffer);
-
- va_start(args, fmt);
- size_out = vsnprintf(buffer, size_buffer, fmt, args);
- va_end(args);
-
- // see http://perfec.to/vsnprintf/pasprintf.c
- // if size_out ...
- // == -1 --> output was truncated
- // == size_buffer --> output was truncated
- // == size_buffer-1 --> ambiguous, /may/ have been truncated
- // > size_buffer --> output was truncated, and size_out
- // bytes would have been written
- if (size_out == size_buffer || size_out == -1 || size_out == size_buffer - 1)
- size_buffer *= 2;
- else if (size_out > size_buffer)
- size_buffer = size_out + 2; // to avoid the ambiguous case
- else
- break;
-
- delete[] buffer;
- }
- mMessage = std::string(buffer);
- delete[] buffer;
- }
-
- Exception::~Exception() throw()
- {
- }
-
-} // namespace JinEngine \ No newline at end of file