/[Search-Estraier]/trunk/Estraier.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/Estraier.pm

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

revision 4 by dpavlin, Wed Jan 4 13:33:07 2006 UTC revision 5 by dpavlin, Wed Jan 4 14:38:35 2006 UTC
# Line 66  sub new { Line 66  sub new {
66    
67    $doc->add_attr( name => 'value' );    $doc->add_attr( name => 'value' );
68    
69    B<FIXME>: delete attribute using
70    
71      $doc->add_attr( name => undef );
72    
73  =cut  =cut
74    
75  sub add_attr {  sub add_attr {
# Line 73  sub add_attr { Line 77  sub add_attr {
77          my $attrs = {@_};          my $attrs = {@_};
78    
79          while (my ($name, $value) = each %{ $attrs }) {          while (my ($name, $value) = each %{ $attrs }) {
80                  push @{$self->{attrs}->{_s($name)}}, _s($value);                  push @{ $self->{attrs}->{_s($name)} }, _s($value);
81          }          }
82  }  }
83    
84    
85    =head2 add_text
86    
87      $doc->add_text('this is example text to display');
88    
89    =cut
90    
91    sub add_text {
92            my $self = shift;
93            my $text = shift;
94            return unless defined($text);
95    
96            push @{ $self->{dtexts} }, _s($text);
97    }
98    
99    
100    =head2 add_hidden_text
101    
102      $doc->add_hidden_text('this is example text just for search');
103    
104    =cut
105    
106    sub add_hidden_text {
107            my $self = shift;
108            my $text = shift;
109            return unless defined($text);
110    
111            push @{ $self->{htexts} }, _s($text);
112    }
113    
114    =head2 dump_draft
115    
116      print $doc->dump_draft;
117    
118    =cut
119    
120    sub dump_draft {
121    }
122    
123  =head2 delete  =head2 delete
124    
125  Empty document object  Empty document object
# Line 88  Empty document object Line 131  Empty document object
131  sub delete {  sub delete {
132          my $self = shift;          my $self = shift;
133    
134          delete($self->{attrs});          foreach my $data (qw/attrs dtexts stexts/) {
135                    delete($self->{$data});
136            }
137    
138          return 1;          return 1;
139  }  }

Legend:
Removed from v.4  
changed lines
  Added in v.5

  ViewVC Help
Powered by ViewVC 1.1.26