Changeset 846


Ignore:
Timestamp:
1999-12-16T15:07:14+13:00 (24 years ago)
Author:
sjboddie
Message:

don't use hashdoc for now

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/basedoc.pm

    r842 r846  
    3636use util;
    3737use html;
    38 use hashdoc;
     38##use hashdoc;
    3939
    4040# the document type may be indexed_doc, nonindexed_doc, or
     
    5353    return $self;
    5454}
     55
     56# clone the $self object
     57sub 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
     70sub 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
    5591
    5692sub set_source_filename {
     
    197233# current contents of the document
    198234# An OID are actually stored as metadata of the document
    199 sub set_OID_file {
     235sub set_OID {
    200236    my $self = shift (@_);
    201237    my ($OID) = @_;
     
    220256}
    221257
    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
     260sub ___set_OID {
    224261    my $self = shift (@_);
    225262    my ($OID) = @_;
     
    504541    my $parent_section = "";
    505542    my $child = "0";
    506     my @section = split (".", $section);
     543    my @section = split (/\./, $section);
    507544    if (scalar(@section) > 0) {
    508545    $child = pop (@section);
     
    713750}
    714751
    715 
     752sub 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}
    716759
    7177601;
  • trunk/gsdl/perllib/doc.pm

    r832 r846  
    5353    return $self;
    5454}
    55 
    56 
    57 sub _calc_OID {
    58     # included for backwards compatibility
    59     # (in particular precalculating OID in HTMLPlug)
    60     return basedoc::_calc_OID(@_);
    61 }
    62 
    6355
    6456# methods for dealing with metadata
Note: See TracChangeset for help on using the changeset viewer.