| 1 | package Hessian::Deserializer::String; | ||
| 2 | |||
| 3 | 32 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | # | ||
| 6 | 32 | ▶ | use feature "switch"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 94 | ▶ | sub read_string_handle_chunk { #{{{ |
|
Subroutine
read_string_handle_chunk: called CC=1 SCAR=0.2
Pod
documented
| |||
| 9 | 94 | my ($self, $first_bit) = @_; | |
| 10 | 94 | my ( $string, $data, $length ); | |
| 11 | 94 | given ($first_bit) { | |
| 12 | 94 | when (/[\x00-\x1f]/) { | |
| 13 | 50 | $length = unpack "n", "\x00" . $first_bit; | |
| 14 | } | ||
| 15 | 44 | when (/[\x30-\x33]/) { | |
| 16 | 0 | $data = $self->read_from_inputhandle(1); | |
| 17 | 0 | my $first_part = $first_bit - 0x30; | |
| 18 | 0 | my $string_length = $first_part . $data; | |
| 19 | |||
| 20 | 0 | $length = unpack "n", "\x00".$data; | |
| 21 | } | ||
| 22 | 44 | when (/[\x52-\x53\x73]/) { | |
| 23 | 44 | $data = $self->read_from_inputhandle(2); | |
| 24 | 44 | $length = unpack "n", $data; | |
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | # binmode( $input_handle, 'utf8' ); | ||
| 29 | 94 | $string = $self->read_from_inputhandle($length); | |
| 30 | 94 | return $string; | |
| 31 | } | ||
| 32 | |||
| 33 | 32 | "one, but we're not the same"; | |
| 34 | |||
| 35 | __END__ | ||