| 1 |
|
| #pragma once |
| 2 |
|
| #include <xs.h> |
| 3 |
|
| #include <panda/uri/URI.h> |
| 4 |
|
| #include <panda/uri/ftp.h> |
| 5 |
|
| #include <panda/uri/http.h> |
| 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 |
|
| struct URIx : URISP { |
| 15 |
|
| using URISP::URISP; |
| 16 |
|
| using URISP::operator=; |
| 17 |
|
| }; |
| 18 |
|
| } |
| 19 |
|
| |
| 20 |
|
| template <class TYPE> struct Typemap<panda::uri::URI*, TYPE> : TypemapObject<panda::uri::URI*, TYPE, ObjectTypeRefcntPtr, ObjectStorageMGBackref, DynamicCast> { |
| 21 |
0 |
| 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<panda::uri::URI*, TYPE, ObjectTypeRefcntPtr, ObjectStorageMGBackref, DynamicCast>::create(var, proto); |
| 25 |
136 |
▶ | if (ret.defined()) xs::uri::data_attach(ret); |
Branch: 30 branches
| Branch | True | False | Total |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
2 |
0 |
2 |
| if (ret.defined()) xs::uri::data_attach(ret); |
2 |
0 |
2 |
| if (ret.defined()) xs::uri::data_attach(ret); |
2 |
0 |
2 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
1 |
0 |
1 |
| if (ret.defined()) xs::uri::data_attach(ret); |
2 |
0 |
2 |
| if (ret.defined()) xs::uri::data_attach(ret); |
2 |
0 |
2 |
| if (ret.defined()) xs::uri::data_attach(ret); |
2 |
0 |
2 |
| if (ret.defined()) xs::uri::data_attach(ret); |
6 |
0 |
6 |
| if (ret.defined()) xs::uri::data_attach(ret); |
6 |
0 |
6 |
| if (ret.defined()) xs::uri::data_attach(ret); |
6 |
0 |
6 |
| if (ret.defined()) xs::uri::data_attach(ret); |
120 |
0 |
120 |
| if (ret.defined()) xs::uri::data_attach(ret); |
120 |
0 |
120 |
| if (ret.defined()) xs::uri::data_attach(ret); |
120 |
0 |
120 |
|
| 26 |
136 |
| return ret; |
| 27 |
|
| } |
| 28 |
|
| }; |
| 29 |
|
| |
| 30 |
|
| template <class TYPE> |
| 31 |
|
| struct Typemap<panda::uri::URISP, panda::iptr<TYPE>> : Typemap<TYPE*> { |
| 32 |
|
| using Super = Typemap<TYPE*>; |
| 33 |
|
| static panda::iptr<TYPE> in (const Sv& arg) { |
| 34 |
|
| if (!arg.defined()) return {}; |
| 35 |
|
| if (!arg.is_object_ref()) return new TYPE(xs::in<panda::string>(arg)); |
| 36 |
|
| return Super::in(arg); |
| 37 |
|
| } |
| 38 |
|
| }; |
| 39 |
|
| |
| 40 |
|
| template <> struct Typemap<xs::uri::URIx> : Typemap<panda::uri::URI*> { |
| 41 |
19 |
| static Sv out (xs::uri::URIx var, const Sv& = Sv()) { |
| 42 |
19 |
▶ | return Typemap<panda::uri::URI*>::out(var, xs::uri::get_perl_class(var)); |
Branch: 2 branches
| Branch | True | False | Total |
| return Typemap<panda::uri::URI*>::out(var, xs::uri::get_perl_class(var)); |
19 |
0 |
19 |
| return Typemap<panda::uri::URI*>::out(var, xs::uri::get_perl_class(var)); |
19 |
0 |
19 |
|
| 43 |
|
| } |
| 44 |
|
| }; |
| 45 |
|
| |
| 46 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::http*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 47 |
0 |
| static panda::string_view package () { return "URI::XS::http"; } |
| 48 |
|
| }; |
| 49 |
|
| |
| 50 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::https*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 51 |
0 |
| static panda::string_view package () { return "URI::XS::https"; } |
| 52 |
|
| }; |
| 53 |
|
| |
| 54 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::ws*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 55 |
0 |
| static panda::string_view package () { return "URI::XS::ws"; } |
| 56 |
|
| }; |
| 57 |
|
| |
| 58 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::wss*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 59 |
0 |
| static panda::string_view package () { return "URI::XS::wss"; } |
| 60 |
|
| }; |
| 61 |
|
| |
| 62 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::ftp*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 63 |
0 |
| static panda::string_view package () { return "URI::XS::ftp"; } |
| 64 |
|
| }; |
| 65 |
|
| |
| 66 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::socks*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 67 |
0 |
| static panda::string_view package () { return "URI::XS::socks"; } |
| 68 |
|
| }; |
| 69 |
|
| |
| 70 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::ssh*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 71 |
0 |
| static panda::string_view package () { return "URI::XS::ssh"; } |
| 72 |
|
| }; |
| 73 |
|
| |
| 74 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::telnet*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 75 |
0 |
| static panda::string_view package () { return "URI::XS::telnet"; } |
| 76 |
|
| }; |
| 77 |
|
| |
| 78 |
|
| template <class TYPE> struct Typemap<panda::uri::URI::sftp*, TYPE> : Typemap<panda::uri::URI*, TYPE> { |
| 79 |
0 |
| static panda::string_view package () { return "URI::XS::sftp"; } |
| 80 |
|
| }; |
| 81 |
|
| } |