Changeset 1731
- Timestamp:
- 2000-11-30T18:42:24+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/SRCPlug.pm
r1707 r1731 1 1 ########################################################################### 2 2 # 3 # SRCPlug.pm -- source code plugin 3 # SRCPlug.pm -- source code plugin 4 # 4 5 # A component of the Greenstone digital library software 5 6 # from the New Zealand Digital Library Project at the … … 25 26 # John McPherson Nov 2000 26 27 # originally based on TEXTPlug 28 27 29 # filename is currently used for Title ( optionally minus some prefix ) 30 31 # Current languages: 32 # text: READMEs/Makefiles 33 # C/C++ (currently extracts #include statements and C++ class decls) 34 # Perl (currently only done as text) 35 # Shell (currently only done as text) 36 28 37 29 38 package SRCPlug; … … 75 84 } 76 85 86 87 77 88 # do plugin specific processing of doc_obj 78 89 sub process { … … 111 122 if ($filetype eq "C++") 112 123 { 113 returnprocess_c_plus_plus($textref,$pluginfo, $base_dir,124 process_c_plus_plus($textref,$pluginfo, $base_dir, 114 125 $file, $metadata, $doc_obj); 115 } 126 } elsif ($filetype eq "C") 127 { 128 get_includes_metadata($textref, $doc_obj); 129 } 130 131 116 132 # default operation... 117 133 # insert preformat tags and add text to document object … … 122 138 123 139 124 sub process_c_plus_plus { 125 my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj) = @_; 126 140 141 142 sub get_includes_metadata { 143 my ($textref, $doc_obj) = @_; 144 127 145 my $topsection = $doc_obj->get_top_section(); 128 129 130 146 131 147 # Get '#include' directives for metadata … … 159 175 } 160 176 } 161 177 } 178 179 180 181 sub process_c_plus_plus { 182 my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj) = @_; 183 184 my $topsection = $doc_obj->get_top_section(); 185 186 187 # Check for include metadata 188 get_includes_metadata($textref, $doc_obj); 162 189 163 190 … … 200 227 } # end of "class" 201 228 202 203 204 205 # insert preformat tags and add text to document object206 $doc_obj->add_utf8_text($topsection, "<pre>\n$$textref\n</pre>");207 208 229 return 1; 209 230 }
Note:
See TracChangeset
for help on using the changeset viewer.