Changeset 846
- Timestamp:
- 1999-12-16T15:07:14+13:00 (24 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/basedoc.pm
r842 r846 36 36 use util; 37 37 use html; 38 use hashdoc;38 ##use hashdoc; 39 39 40 40 # the document type may be indexed_doc, nonindexed_doc, or … … 53 53 return $self; 54 54 } 55 56 # clone the $self object 57 sub duplicate { 58 my $self = shift (@_); 59 60 my $newobj = {}; 61 62 foreach $k (keys %$self) { 63 $newobj->{$k} = &clone ($self->{$k}); 64 } 65 66 bless $newobj, ref($self); 67 return $newobj; 68 } 69 70 sub clone { 71 my ($from) = @_; 72 my $type = ref ($from); 73 74 if ($type eq "HASH") { 75 my $to = {}; 76 foreach $key (keys %$from) { 77 $to->{$key} = &clone ($from->{$key}); 78 } 79 return $to; 80 } elsif ($type eq "ARRAY") { 81 my $to = []; 82 foreach $v (@$from) { 83 push (@$to, &clone ($v)); 84 } 85 return $to; 86 } else { 87 return $from; 88 } 89 } 90 55 91 56 92 sub set_source_filename { … … 197 233 # current contents of the document 198 234 # An OID are actually stored as metadata of the document 199 sub set_OID _file{235 sub set_OID { 200 236 my $self = shift (@_); 201 237 my ($OID) = @_; … … 220 256 } 221 257 222 223 sub set_OID { 258 # this uses hashdoc (embedded c thingy) which is faster but still 259 # needs a little work to be suffiently stable 260 sub ___set_OID { 224 261 my $self = shift (@_); 225 262 my ($OID) = @_; … … 504 541 my $parent_section = ""; 505 542 my $child = "0"; 506 my @section = split ( ".", $section);543 my @section = split (/\./, $section); 507 544 if (scalar(@section) > 0) { 508 545 $child = pop (@section); … … 713 750 } 714 751 715 752 sub reset_nextsection_ptr { 753 my $self = shift (@_); 754 my ($section) = @_; 755 756 my $section_ptr = $self->_lookup_section($section); 757 $section_ptr->{'next_subsection'} = 1; 758 } 716 759 717 760 1; -
trunk/gsdl/perllib/doc.pm
r832 r846 53 53 return $self; 54 54 } 55 56 57 sub _calc_OID {58 # included for backwards compatibility59 # (in particular precalculating OID in HTMLPlug)60 return basedoc::_calc_OID(@_);61 }62 63 55 64 56 # methods for dealing with metadata
Note:
See TracChangeset
for help on using the changeset viewer.