| 1 | package HTTP::MobileAgent::EZweb; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 9 | ▶ | use vars qw($VERSION); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 9 | $VERSION = 0.19; | |||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 9 | ▶ | use base qw(HTTP::MobileAgent); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 9 | __PACKAGE__->make_accessors( | |||||||||||||||||||
| 10 | qw(version model device_id server xhtml_compliant comment) | ||||||||||||||||||||
| 11 | ); | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 161 | ▶ | sub is_ezweb { 1 } | ||||||||||||||||||
|
Subroutine
is_ezweb: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 0 | ▶ | sub carrier { 'E' } | ||||||||||||||||||
|
Subroutine
carrier: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 0 | ▶ | sub carrier_longname { 'EZweb' } | ||||||||||||||||||
|
Subroutine
carrier_longname: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | sub is_tuka { | ||||||||||||||||||||
| 20 | 5 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
is_tuka: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||
| 21 | 5 | my $tuka = substr($self->device_id, 2, 1); | |||||||||||||||||||
| 22 | 5 | ▶ | if($self->is_wap2){ | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 23 | 2 | ▶ | return 1 if $tuka eq 'U'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 24 | } else { | ||||||||||||||||||||
| 25 | 3 | ▶ | return 1 if $tuka eq 'T'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | sub parse { | ||||||||||||||||||||
| 30 | 150 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
parse: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||
| 31 | 150 | my $ua = $self->user_agent; | |||||||||||||||||||
| 32 | 150 | ▶ | if ($ua =~ s/^KDDI\-//) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 33 | # KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 | ||||||||||||||||||||
| 34 | 29 | $self->{xhtml_compliant} = 1; | |||||||||||||||||||
| 35 | 29 | my($device, $browser, $opt, $server) = split / /, $ua, 4; | |||||||||||||||||||
| 36 | 29 | $self->{device_id} = $device; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 29 | my($name, $version) = split m!/!, $browser; | |||||||||||||||||||
| 39 | 29 | $self->{name} = $name; | |||||||||||||||||||
| 40 | 29 | $self->{version} = "$version $opt"; | |||||||||||||||||||
| 41 | 29 | $self->{server} = $server; | |||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | else { | ||||||||||||||||||||
| 44 | # UP.Browser/3.01-HI01 UP.Link/3.4.5.2 | ||||||||||||||||||||
| 45 | 121 | my($browser, $server, $comment) = split / /, $ua, 3; | |||||||||||||||||||
| 46 | 121 | my($name, $software) = split m!/!, $browser; | |||||||||||||||||||
| 47 | 121 | $self->{name} = $name; | |||||||||||||||||||
| 48 | 121 | @{$self}{qw(version device_id)} = split /-/, $software; | |||||||||||||||||||
| 49 | 121 | $self->{server} = $server; | |||||||||||||||||||
| 50 | 121 | ▶ | if ($comment) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 51 | 6 | $comment =~ s/^\((.*)\)$/$1/; | |||||||||||||||||||
| 52 | 6 | $self->{comment} = $comment; | |||||||||||||||||||
| 53 | } | ||||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | 150 | $self->{model} = $self->{device_id}; | |||||||||||||||||||
| 56 | } | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | sub _make_display { | ||||||||||||||||||||
| 59 | 2 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
_make_display: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 60 | 2 | my($width, $height) = split /,/, $self->get_header('x-up-devcap-screenpixels'); | |||||||||||||||||||
| 61 | 2 | my $depth = (split /,/, $self->get_header('x-up-devcap-screendepth'))[0]; | |||||||||||||||||||
| 62 | 2 | my $color = $self->get_header('x-up-devcap-iscolor'); | |||||||||||||||||||
| 63 | 2 | ▶ | return HTTP::MobileAgent::Display->new( | ||||||||||||||||||
|
Condition66%2/3
defined $color && $color eq '1'
MC/DC50%1/2
defined $color && $color eq '1'
defined $color
$color eq '1'
Truth table66%2/3
A && B
A= defined $colorB= $color eq '1'
| |||||||||||||||||||||
| 64 | width => $width, | ||||||||||||||||||||
| 65 | height => $height, | ||||||||||||||||||||
| 66 | color => (defined $color && $color eq '1'), | ||||||||||||||||||||
| 67 | depth => 2 ** $depth, | ||||||||||||||||||||
| 68 | ); | ||||||||||||||||||||
| 69 | } | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | 9 | 1; | |||||||||||||||||||
| 72 | __END__ | ||||||||||||||||||||