1 |
|
|
/* |
2 |
|
|
* Copyright 2010, |
3 |
|
|
* François Bleibel, |
4 |
|
|
* Olivier Stasse, |
5 |
|
|
* |
6 |
|
|
* CNRS/AIST |
7 |
|
|
* |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#include <dynamic-graph/exception-signal.h> |
11 |
|
|
#include <stdarg.h> |
12 |
|
|
|
13 |
|
|
#include <cstdio> |
14 |
|
|
|
15 |
|
|
using namespace dynamicgraph; |
16 |
|
|
|
17 |
|
|
/* --------------------------------------------------------------------- */ |
18 |
|
|
/* --- CLASS ----------------------------------------------------------- */ |
19 |
|
|
/* --------------------------------------------------------------------- */ |
20 |
|
|
|
21 |
|
|
const std::string ExceptionSignal::EXCEPTION_NAME = "Signal"; |
22 |
|
|
|
23 |
|
20 |
ExceptionSignal::ExceptionSignal(const ExceptionSignal::ErrorCodeEnum &errcode, |
24 |
|
20 |
const std::string &msg) |
25 |
✓✗ |
20 |
: ExceptionAbstract(errcode, msg) {} |
26 |
|
|
|
27 |
|
14 |
ExceptionSignal::ExceptionSignal(const ExceptionSignal::ErrorCodeEnum &errcode, |
28 |
|
|
const std::string &msg, const char *format, |
29 |
|
14 |
...) |
30 |
✓✗ |
14 |
: ExceptionAbstract(errcode, msg) { |
31 |
|
|
va_list args; |
32 |
|
14 |
va_start(args, format); |
33 |
|
|
|
34 |
|
14 |
const unsigned int SIZE = 256; |
35 |
|
|
char buffer[SIZE]; |
36 |
|
14 |
vsnprintf(buffer, SIZE, format, args); |
37 |
|
|
|
38 |
✓✗ |
14 |
message += buffer; |
39 |
|
|
|
40 |
|
14 |
va_end(args); |
41 |
|
14 |
} |
42 |
|
|
|
43 |
|
|
/* |
44 |
|
|
* Local variables: |
45 |
|
|
* c-basic-offset: 2 |
46 |
|
|
* End: |
47 |
|
|
*/ |