File Coverage

src/xs/uri.h
Criterion Covered Total %
statement 8 17 47.0
branch 21 42 50.0
condition n/a
subroutine n/a
pod n/a
total 29 59 49.1


line stmt bran cond sub pod time code
1             #pragma once
2             #include
3             #include
4             #include
5             #include
6              
7             namespace xs {
8             namespace uri {
9             using panda::uri::URISP;
10              
11             void data_attach (Sv& sv);
12             Stash get_perl_class (const panda::uri::URI* uri);
13              
14 114           struct URIx : URISP {
15             using URISP::URISP;
16             using URISP::operator=;
17             };
18             }
19              
20             template struct Typemap : TypemapObject {
21 4           static panda::string_view package () { return "URI::XS"; }
22              
23 136           static Sv create (const TYPE& var, const Sv& proto = Sv()) {
24 136           auto ret = TypemapObject::create(var, proto);
25 136 50         if (ret.defined()) xs::uri::data_attach(ret);
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
26 136           return ret;
27             }
28             };
29              
30             template
31             struct Typemap> : Typemap {
32             using Super = Typemap;
33             static panda::iptr in (const Sv& arg) {
34             if (!arg.defined()) return {};
35             if (!arg.is_object_ref()) return new TYPE(xs::in(arg));
36             return Super::in(arg);
37             }
38             };
39              
40             template <> struct Typemap : Typemap {
41 19           static Sv out (xs::uri::URIx var, const Sv& = Sv()) {
42 19 50         return Typemap::out(var, xs::uri::get_perl_class(var));
43             }
44             };
45              
46             template struct Typemap : Typemap {
47 0           static panda::string_view package () { return "URI::XS::http"; }
48             };
49              
50             template struct Typemap : Typemap {
51 0           static panda::string_view package () { return "URI::XS::https"; }
52             };
53              
54             template struct Typemap : Typemap {
55 0           static panda::string_view package () { return "URI::XS::ws"; }
56             };
57              
58             template struct Typemap : Typemap {
59 0           static panda::string_view package () { return "URI::XS::wss"; }
60             };
61              
62             template struct Typemap : Typemap {
63 0           static panda::string_view package () { return "URI::XS::ftp"; }
64             };
65              
66             template struct Typemap : Typemap {
67 0           static panda::string_view package () { return "URI::XS::socks"; }
68             };
69              
70             template struct Typemap : Typemap {
71 0           static panda::string_view package () { return "URI::XS::ssh"; }
72             };
73              
74             template struct Typemap : Typemap {
75 0           static panda::string_view package () { return "URI::XS::telnet"; }
76             };
77              
78             template struct Typemap : Typemap {
79 0           static panda::string_view package () { return "URI::XS::sftp"; }
80             };
81             }