| 1 |
|
| MODULE = Geo::Geos PACKAGE = Geo::Geos::WKBReader |
| 2 |
|
| PROTOTYPES: DISABLE |
| 3 |
|
| |
| 4 |
|
| Sv read(std::string in, SV* geometry_factory = NULL) { |
| 5 |
3 |
▶ | std::istringstream in_stream(in); |
Branch: 1 branch
| Branch | True | False | Total |
| std::istringstream in_stream(in); |
3 |
0 |
3 |
|
| 6 |
|
| Geometry* g; |
| 7 |
3 |
▶ | if (geometry_factory) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (geometry_factory) { |
2 |
1 |
3 |
|
| 8 |
2 |
▶ | WKBReader r(xs::in<GeometryFactory&>(geometry_factory)); |
Branch: 2 branches
| Branch | True | False | Total |
| WKBReader r(xs::in<GeometryFactory&>(geometry_factory)); |
2 |
0 |
2 |
| WKBReader r(xs::in<GeometryFactory&>(geometry_factory)); |
2 |
0 |
2 |
|
| 9 |
2 |
▶ | g = r.read(in_stream); |
Branch: 1 branch
| Branch | True | False | Total |
| g = r.read(in_stream); |
2 |
0 |
2 |
|
| 10 |
2 |
| } |
| 11 |
|
| else { |
| 12 |
1 |
▶ | WKBReader r; |
Branch: 1 branch
| Branch | True | False | Total |
| WKBReader r; |
1 |
0 |
1 |
|
| 13 |
1 |
▶ | g = r.read(in_stream); |
Branch: 1 branch
| Branch | True | False | Total |
| g = r.read(in_stream); |
1 |
0 |
1 |
|
| 14 |
1 |
| } |
| 15 |
3 |
▶ | RETVAL = Helper::uplift(g); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = Helper::uplift(g); |
3 |
0 |
3 |
|
| 16 |
|
| } |
| 17 |
|
| |
| 18 |
|
| Sv readHEX(std::string in, SV* geometry_factory = NULL) { |
| 19 |
3 |
▶ | std::istringstream in_stream(in); |
Branch: 1 branch
| Branch | True | False | Total |
| std::istringstream in_stream(in); |
3 |
0 |
3 |
|
| 20 |
|
| Geometry* g; |
| 21 |
3 |
▶ | if (geometry_factory) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (geometry_factory) { |
2 |
1 |
3 |
|
| 22 |
2 |
▶ | WKBReader r(xs::in<GeometryFactory&>(geometry_factory)); |
Branch: 2 branches
| Branch | True | False | Total |
| WKBReader r(xs::in<GeometryFactory&>(geometry_factory)); |
2 |
0 |
2 |
| WKBReader r(xs::in<GeometryFactory&>(geometry_factory)); |
2 |
0 |
2 |
|
| 23 |
2 |
▶ | g = r.readHEX(in_stream); |
Branch: 1 branch
| Branch | True | False | Total |
| g = r.readHEX(in_stream); |
2 |
0 |
2 |
|
| 24 |
2 |
| } |
| 25 |
|
| else { |
| 26 |
1 |
▶ | WKBReader r; |
Branch: 1 branch
| Branch | True | False | Total |
| WKBReader r; |
1 |
0 |
1 |
|
| 27 |
1 |
▶ | g = r.readHEX(in_stream); |
Branch: 1 branch
| Branch | True | False | Total |
| g = r.readHEX(in_stream); |
1 |
0 |
1 |
|
| 28 |
1 |
| } |
| 29 |
3 |
▶ | RETVAL = Helper::uplift(g); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = Helper::uplift(g); |
3 |
0 |
3 |
|
| 30 |
|
| } |
| 31 |
|
| |