/[cvs]/nfo/perl/libs/Data/Mungle/Transform/Deep.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Mungle/Transform/Deep.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by jonen, Thu Feb 27 14:39:48 2003 UTC revision 1.20 by joko, Fri Apr 4 17:31:23 2003 UTC
# Line 2  Line 2 
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  ##  ##
# Line 56  Line 71 
71  ## ---------------------------------------------------------------------------  ## ---------------------------------------------------------------------------
72    
73    
74  package Data::Transform::Deep;  package Data::Mungle::Transform::Deep;
75    
76  use strict;  use strict;
77  use warnings;  use warnings;
# Line 75  use Data::Dumper; Line 90  use Data::Dumper;
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;
# Line 291  sub _var_traverse_mixin_update_old { Line 306  sub _var_traverse_mixin_update_old {
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    
# Line 479  sub deep_copy { Line 494  sub deep_copy {
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    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.20

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed