2 |
## $Id$ |
## $Id$ |
3 |
## --------------------------------------------------------------------------- |
## --------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.20 2003/04/04 17:31:23 joko |
6 |
|
## minor update to 'childObj2string' |
7 |
|
## |
8 |
|
## Revision 1.19 2003/03/28 03:11:25 jonen |
9 |
|
## + bugfix |
10 |
|
## |
11 |
|
## Revision 1.18 2003/03/28 03:07:26 jonen |
12 |
|
## + minor changes |
13 |
|
## |
14 |
|
## Revision 1.17 2003/03/27 15:17:07 joko |
15 |
|
## namespace fixes for Data::Mungle::* |
16 |
|
## |
17 |
|
## Revision 1.16 2003/03/27 15:04:52 joko |
18 |
|
## minor update: comment |
19 |
|
## |
20 |
## Revision 1.15 2003/02/27 14:39:48 jonen |
## Revision 1.15 2003/02/27 14:39:48 jonen |
21 |
## + fixed bug at _hash2object() |
## + fixed bug at _hash2object() |
22 |
## |
## |
71 |
## --------------------------------------------------------------------------- |
## --------------------------------------------------------------------------- |
72 |
|
|
73 |
|
|
74 |
package Data::Transform::Deep; |
package Data::Mungle::Transform::Deep; |
75 |
|
|
76 |
use strict; |
use strict; |
77 |
use warnings; |
use warnings; |
90 |
use Iterate; |
use Iterate; |
91 |
|
|
92 |
use Pitonyak::DeepCopy; |
use Pitonyak::DeepCopy; |
93 |
use Data::Transform::Encode qw( latin_to_utf8 latin_to_utf8_scalar utf8_to_latin utf8_to_latin_scalar ); |
use Data::Mungle::Transform::Encode qw( latin_to_utf8 latin_to_utf8_scalar utf8_to_latin utf8_to_latin_scalar ); |
94 |
use Data::Code::Ref qw( ref_slot ); |
use Data::Mungle::Code::Ref qw( ref_slot ); |
95 |
|
|
96 |
sub numhash2list { |
sub numhash2list { |
97 |
my $vref = shift; |
my $vref = shift; |
306 |
sub merge_to { |
sub merge_to { |
307 |
_hash2object(@_); |
_hash2object(@_); |
308 |
# TODO: |
# TODO: |
309 |
# re-implement using CPAN's "Iterate". |
# re-implement using CPAN's "Iterate" and/or a modified Hash::Merge. |
310 |
} |
} |
311 |
|
|
312 |
|
|
494 |
} |
} |
495 |
|
|
496 |
|
|
497 |
|
# encodes object-references to serialized string representations |
498 |
|
# made up of: |
499 |
|
# - 'o_<classname>_<ref type>_<guid>'??? |
500 |
|
# - 'o_{guid}_{classname}'!!! |
501 |
sub childObj2string { |
sub childObj2string { |
502 |
my $obj = shift; |
my $obj = shift; |
503 |
my $option = shift; |
my $option = shift; |
504 |
my $classname = ref $obj; |
my $string = 'n/a'; |
505 |
|
|
506 |
|
if ($option == 1) { |
507 |
|
if ((my $classname = ref $obj) && (my $guid = $obj->{guid})) { |
508 |
|
$string = join('_', 'o', $guid, $classname); |
509 |
|
} |
510 |
|
} |
511 |
|
|
512 |
if($option == 1) { |
return $string; |
|
my $string = "o_" . $classname . "_" .$obj->{guid}; |
|
|
return $string; |
|
|
} |
|
513 |
} |
} |
514 |
|
|
515 |
|
|