line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include "base.h" |
3
|
|
|
|
|
|
|
#include "../Simple.h" |
4
|
|
|
|
|
|
|
#include |
5
|
|
|
|
|
|
|
#include |
6
|
|
|
|
|
|
|
#include |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
namespace xs { |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
template <> struct Typemap : TypemapBase { |
11
|
|
|
|
|
|
|
static inline panda::string in (SV* arg) { |
12
|
|
|
|
|
|
|
STRLEN len; |
13
|
|
|
|
|
|
|
const char* data = SvPV_nomg(arg, len); |
14
|
|
|
|
|
|
|
return panda::string(data, len); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
static inline Sv out (const panda::string& str, const Sv& = Sv()) { return Simple(str); } |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
template <> struct Typemap : TypemapBase { |
20
|
|
|
|
|
|
|
static inline std::string in (SV* arg) { |
21
|
|
|
|
|
|
|
STRLEN len; |
22
|
|
|
|
|
|
|
const char* data = SvPV_nomg(arg, len); |
23
|
|
|
|
|
|
|
return std::string(data, len); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
static inline Sv out (const std::string& str, const Sv& = Sv()) { return Simple(panda::string_view(str.data(), str.length())); } |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
template <> struct Typemap : TypemapBase { |
29
|
0
|
|
|
|
|
|
static inline panda::string_view in (SV* arg) { |
30
|
|
|
|
|
|
|
STRLEN len; |
31
|
0
|
0
|
|
|
|
|
const char* data = SvPV_nomg(arg, len); |
|
|
0
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
return panda::string_view(data, len); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
static inline Sv out (const panda::string_view& str, const Sv& = Sv()) { return Simple(str); } |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} |