--- nfo/perl/libs/Data/Mungle/Transform/Deep.pm 2003/04/04 17:31:23 1.20 +++ nfo/perl/libs/Data/Mungle/Transform/Deep.pm 2003/04/09 07:21:56 1.21 @@ -1,7 +1,10 @@ ## --------------------------------------------------------------------------- -## $Id: Deep.pm,v 1.20 2003/04/04 17:31:23 joko Exp $ +## $Id: Deep.pm,v 1.21 2003/04/09 07:21:56 joko Exp $ ## --------------------------------------------------------------------------- ## $Log: Deep.pm,v $ +## Revision 1.21 2003/04/09 07:21:56 joko +## childObj2string now inside Encode.pm, renamed to 'twingle_reference' +## ## Revision 1.20 2003/04/04 17:31:23 joko ## minor update to 'childObj2string' ## @@ -90,7 +93,7 @@ use Iterate; use Pitonyak::DeepCopy; -use Data::Mungle::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 twingle_reference ); use Data::Mungle::Code::Ref qw( ref_slot ); sub numhash2list { @@ -181,7 +184,7 @@ # if $options->{childObj2string} is TRUE or STRING don't expand referenced object, # instead replace it by per option choosed string (default: o___ ) if ($item && $options->{childObj2string}) { - $item = childObj2string($item, $options->{childObj2string}); + $item = twingle_reference($item); } else { # ... expand structure recursively $item = expand($_[0], $options); @@ -218,7 +221,7 @@ # if $options->{childObj2string} is TRUE or STRING don't expand referenced object, # instead replace it by per option choosed string (default: o___ ) if ($item && $options->{childObj2string} && !(ref $_[1] eq "ARRAY") && !(ref $_[1] eq "HASH")) { - $item = childObj2string($item, $options->{childObj2string}); + $item = twingle_reference($item); } else { # ... expand structure recursively $item = expand($_[1], $options); @@ -494,24 +497,5 @@ } -# encodes object-references to serialized string representations -# made up of: -# - 'o___'??? -# - 'o_{guid}_{classname}'!!! -sub childObj2string { - my $obj = shift; - my $option = shift; - my $string = 'n/a'; - - if ($option == 1) { - if ((my $classname = ref $obj) && (my $guid = $obj->{guid})) { - $string = join('_', 'o', $guid, $classname); - } - } - - return $string; -} - - 1; __END__