line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODE: INLINE |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
void register_error_constants(); // regerror.cc, because fucking xsubpp removes preprocessor directives |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
MODULE = XS::Framework PACKAGE = XS::STL::ErrorCode |
6
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BOOT { |
9
|
36
|
|
|
|
|
|
register_error_constants(); |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
std::error_code new (SV*, int ec, const std::error_category* category) { |
13
|
2
|
|
|
|
|
|
if (!category) throw "category required"; |
14
|
1
|
50
|
|
|
|
|
RETVAL = std::error_code(ec, *category); |
15
|
1
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
int value (std::error_code ec) { |
18
|
126
|
|
|
|
|
|
RETVAL = ec.value(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
const std::error_category* category (std::error_code ec) { |
22
|
4
|
|
|
|
|
|
RETVAL = &ec.category(); |
23
|
2
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
std::string message (std::error_code ec) { |
26
|
2
|
50
|
|
|
|
|
RETVAL = ec.message(); |
|
|
50
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
std::string _op_string (std::error_code ec, ...) { |
30
|
0
|
0
|
|
|
|
|
RETVAL = ec.message(); |
|
|
0
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
RETVAL += " ("; |
32
|
0
|
0
|
|
|
|
|
RETVAL += std::to_string(ec.value()); |
|
|
0
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
RETVAL += ":"; |
34
|
0
|
0
|
|
|
|
|
RETVAL += ec.category().name(); |
35
|
0
|
0
|
|
|
|
|
RETVAL += ")"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
bool _op_bool (std::error_code ec, ...) { |
39
|
0
|
|
|
|
|
|
RETVAL = ec.value(); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
bool _op_eq (std::error_code ec1, Sv sv_ec2, ...) { |
43
|
64
|
100
|
|
|
|
|
if (sv_ec2.is_object_ref()) { |
44
|
124
|
50
|
|
|
|
|
Object ec2 = sv_ec2; |
45
|
62
|
50
|
|
|
|
|
auto class_name = ec2.stash().name(); |
46
|
62
|
50
|
|
|
|
|
if (class_name == "XS::ErrorCode") { |
|
|
50
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
RETVAL = ec1 == xs::in(sv_ec2); |
48
|
62
|
50
|
|
|
|
|
} else if (class_name == "XS::STL::ErrorCode") { |
|
|
50
|
|
|
|
|
|
49
|
62
|
50
|
|
|
|
|
RETVAL = ec1 == xs::in(sv_ec2); |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
|
RETVAL = false; |
52
|
|
|
|
|
|
|
} |
53
|
2
|
50
|
|
|
|
|
} else if (SvIOK(sv_ec2)) { |
54
|
2
|
50
|
|
|
|
|
int code = Simple(sv_ec2); |
|
|
50
|
|
|
|
|
|
55
|
2
|
|
|
|
|
|
RETVAL = ec1.value() == code; |
56
|
|
|
|
|
|
|
} else { |
57
|
0
|
|
|
|
|
|
RETVAL = false; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
bool _op_and(std::error_code e1, std::error_code e2, ...) { |
62
|
1
|
|
|
|
|
|
RETVAL = (e1 == e2); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
MODULE = XS::Framework PACKAGE = XS::STL::ErrorCategory |
66
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
|
|
|
const char* std::error_category::name () : const |
69
|
|
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
|
std::string std::error_category::message (int ec) : const |
|
|
0
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
std::string std::error_category::_op_string (...) : const { |
73
|
0
|
0
|
|
|
|
|
RETVAL = THIS->name(); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
bool std::error_category::_op_eq (const std::error_category* oth, ...) : const { |
77
|
3
|
|
|
|
|
|
RETVAL = *THIS == *oth; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
MODULE = XS::Framework PACKAGE = XS::ErrorCode |
81
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
ErrorCode new (SV*, std::error_code c, ErrorCode next = ErrorCode()) { |
84
|
0
|
|
|
|
|
|
if (next) RETVAL = ErrorCode(c, next); |
85
|
0
|
0
|
|
|
|
|
else RETVAL = ErrorCode(c); |
86
|
0
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
int value (ErrorCode ec) { |
89
|
2
|
|
|
|
|
|
RETVAL = ec.value(); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
const std::error_category* category (ErrorCode ec) { |
93
|
2
|
|
|
|
|
|
RETVAL = &ec.category(); |
94
|
1
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
std::string message (ErrorCode ec) { |
97
|
1
|
50
|
|
|
|
|
RETVAL = ec.message(); |
|
|
50
|
|
|
|
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
std::error_code code (ErrorCode ec) { |
101
|
2
|
|
|
|
|
|
RETVAL = ec.code(); |
102
|
1
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
ErrorCode next (ErrorCode ec) { |
105
|
2
|
|
|
|
|
|
RETVAL = ec.next(); |
106
|
1
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
std::string _op_string (ErrorCode ec, ...) { |
109
|
0
|
0
|
|
|
|
|
if (!ec) XSRETURN_UNDEF; |
110
|
0
|
0
|
|
|
|
|
RETVAL = ec.what(); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
bool _op_bool (ErrorCode ec, ...) { |
114
|
0
|
|
|
|
|
|
RETVAL = ec.value(); |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
bool _op_eq (ErrorCode ec1, Sv sv_ec2, ...) { |
118
|
5
|
100
|
|
|
|
|
if (sv_ec2.is_object_ref()) { |
119
|
8
|
50
|
|
|
|
|
Object ec2 = sv_ec2; |
120
|
4
|
50
|
|
|
|
|
auto class_name = ec2.stash().name(); |
121
|
4
|
50
|
|
|
|
|
if (class_name == "XS::ErrorCode") { |
|
|
100
|
|
|
|
|
|
122
|
1
|
50
|
|
|
|
|
RETVAL = ec1 == xs::in(sv_ec2); |
123
|
3
|
50
|
|
|
|
|
} else if (class_name == "XS::STL::ErrorCode") { |
|
|
50
|
|
|
|
|
|
124
|
3
|
50
|
|
|
|
|
RETVAL = ec1 == xs::in(sv_ec2); |
125
|
|
|
|
|
|
|
} else { |
126
|
0
|
|
|
|
|
|
RETVAL = false; |
127
|
|
|
|
|
|
|
} |
128
|
1
|
50
|
|
|
|
|
} else if (SvIOK(sv_ec2)) { |
129
|
1
|
50
|
|
|
|
|
int code = Simple(sv_ec2); |
|
|
50
|
|
|
|
|
|
130
|
1
|
|
|
|
|
|
RETVAL = ec1.value() == code; |
131
|
|
|
|
|
|
|
} else { |
132
|
0
|
|
|
|
|
|
RETVAL = false; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
bool contains(ErrorCode ec, std::error_code c) { |
137
|
1
|
50
|
|
|
|
|
RETVAL = ec.contains(c); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
bool _op_and(ErrorCode ec, std::error_code c, ...) { |
141
|
3
|
50
|
|
|
|
|
RETVAL = ec.contains(c); |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|