/[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.16 by joko, Thu Mar 27 15:04:52 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  ##  Revision 1.16  2003/03/27 15:04:52  joko
18  ##  minor update: comment  ##  minor update: comment
19  ##  ##
# Line 59  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 78  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 482  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.16  
changed lines
  Added in v.1.20

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