line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
// remove OpenBSD pollution macro |
5
|
|
|
|
|
|
|
#undef fileno |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
namespace xs { |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
using xs::my_perl; |
10
|
|
|
|
|
|
|
|
11
|
446
|
|
|
|
|
|
struct Io : Sv { |
12
|
|
|
|
|
|
|
static Io noinc (SV* val) { return Io(val, NONE); } |
13
|
|
|
|
|
|
|
static Io noinc (IO* val) { return Io(val, NONE); } |
14
|
|
|
|
|
|
|
|
15
|
46
|
|
|
|
|
|
Io (std::nullptr_t = nullptr) {} |
16
|
103
|
100
|
|
|
|
|
Io (SV* sv, bool policy = INCREMENT) : Sv(sv, policy) { _validate(); } |
17
|
3
|
50
|
|
|
|
|
Io (GV* sv, bool policy = INCREMENT) : Sv(sv, policy) { _validate(); } |
18
|
192
|
|
|
|
|
|
Io (IO* sv, bool policy = INCREMENT) : Sv(sv, policy) {} |
19
|
|
|
|
|
|
|
|
20
|
86
|
|
|
|
|
|
Io (const Io& oth) : Sv(oth) {} |
21
|
2
|
|
|
|
|
|
Io (Io&& oth) : Sv(std::move(oth)) {} |
22
|
3
|
100
|
|
|
|
|
Io (const Sv& oth) : Sv(oth) { _validate(); } |
23
|
3
|
100
|
|
|
|
|
Io (Sv&& oth) : Sv(std::move(oth)) { _validate(); } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Io (const Simple&) = delete; |
26
|
|
|
|
|
|
|
Io (const Array&) = delete; |
27
|
|
|
|
|
|
|
Io (const Hash&) = delete; |
28
|
|
|
|
|
|
|
Io (const Sub&) = delete; |
29
|
|
|
|
|
|
|
|
30
|
48
|
|
|
|
|
|
Io& operator= (SV* val) { Sv::operator=(val); _validate(); return *this; } |
31
|
4
|
|
|
|
|
|
Io& operator= (GV* val) { Sv::operator=(val); _validate(); return *this; } |
32
|
4
|
|
|
|
|
|
Io& operator= (IO* val) { Sv::operator=(val); return *this; } |
33
|
4
|
|
|
|
|
|
Io& operator= (const Io& oth) { Sv::operator=(oth); return *this; } |
34
|
4
|
|
|
|
|
|
Io& operator= (Io&& oth) { Sv::operator=(std::move(oth)); return *this; } |
35
|
6
|
|
|
|
|
|
Io& operator= (const Sv& oth) { return operator=(oth.get()); } |
36
|
6
|
|
|
|
|
|
Io& operator= (Sv&& oth) { Sv::operator=(std::move(oth)); _validate(); return *this; } |
37
|
|
|
|
|
|
|
Io& operator= (const Simple&) = delete; |
38
|
|
|
|
|
|
|
Io& operator= (const Array&) = delete; |
39
|
|
|
|
|
|
|
Io& operator= (const Hash&) = delete; |
40
|
|
|
|
|
|
|
Io& operator= (const Sub&) = delete; |
41
|
|
|
|
|
|
|
|
42
|
2
|
|
|
|
|
|
void set (SV* val) { Sv::operator=(val); } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
operator AV* () const = delete; |
45
|
|
|
|
|
|
|
operator HV* () const = delete; |
46
|
|
|
|
|
|
|
operator CV* () const = delete; |
47
|
|
|
|
|
|
|
operator GV* () const = delete; |
48
|
2
|
|
|
|
|
|
operator IO* () const { return (IO*)sv; } |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
IO* operator-> () const { return (IO*)sv; } |
51
|
|
|
|
|
|
|
|
52
|
74
|
|
|
|
|
|
template panda::enable_if_one_of_t* get () const { return (T*)sv; } |
53
|
|
|
|
|
|
|
|
54
|
6
|
|
|
|
|
|
int fileno () const { return PerlIO_fileno(ifp()); } |
55
|
|
|
|
|
|
|
|
56
|
6
|
|
|
|
|
|
PerlIO* ifp () const { return IoIFP(sv); } |
57
|
|
|
|
|
|
|
PerlIO* ofp () const { return IoOFP(sv); } |
58
|
|
|
|
|
|
|
|
59
|
4
|
|
|
|
|
|
char iotype () const { return IoTYPE(sv); } |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
private: |
62
|
|
|
|
|
|
|
void _validate (); |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
} |