line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
namespace xs { |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
struct Sub; struct Hash; struct Array; |
7
|
|
|
|
|
|
|
|
8
|
638
|
|
|
|
|
|
struct KeyProxy : Scalar { |
9
|
319
|
50
|
|
|
|
|
KeyProxy (SV** ptr, bool nullok) : Scalar(), ptr(ptr), nullok(nullok) { set(*ptr); } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
KeyProxy& operator= (std::nullptr_t) { return operator=(Scalar()); } |
12
|
|
|
|
|
|
|
KeyProxy& operator= (const KeyProxy& v) { return operator=((Scalar)v); } |
13
|
|
|
|
|
|
|
KeyProxy& operator= (const Scalar& val) { |
14
|
|
|
|
|
|
|
Scalar::operator=(val); |
15
|
|
|
|
|
|
|
SV* newsv = val; |
16
|
|
|
|
|
|
|
if (nullok || newsv) SvREFCNT_inc_simple_void(newsv); |
17
|
|
|
|
|
|
|
else newsv = newSV(0); |
18
|
|
|
|
|
|
|
auto old = *ptr; |
19
|
|
|
|
|
|
|
*ptr = newsv; |
20
|
|
|
|
|
|
|
SvREFCNT_dec(old); |
21
|
|
|
|
|
|
|
return *this; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
KeyProxy& operator= (SV* v) { return operator=(Scalar(v)); } |
24
|
|
|
|
|
|
|
KeyProxy& operator= (const Sv& v) { return operator=(Scalar(v)); } |
25
|
|
|
|
|
|
|
KeyProxy& operator= (const Array&) = delete; |
26
|
|
|
|
|
|
|
KeyProxy& operator= (const Hash&) = delete; |
27
|
|
|
|
|
|
|
KeyProxy& operator= (const Sub&) = delete; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
KeyProxy operator[] (size_t key); |
30
|
|
|
|
|
|
|
KeyProxy operator[] (const panda::string_view& key); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
private: |
33
|
|
|
|
|
|
|
SV** ptr; |
34
|
|
|
|
|
|
|
bool nullok; |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} |