Ignore:
Timestamp:
2019-02-25T22:06:06+13:00 (5 years ago)
Author:
davidb
Message:

Refactored to use inheritance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/heritage-nz/collect/reports-2019/perllib/plugins/CSVPlugin.pm

    r32810 r32812  
    2929use SplitTextFile;
    3030use MetadataRead;
     31use CSVFieldSeparator;
     32
    3133use strict;
    3234no strict 'refs'; # allow filehandles to be variables and viceversa
     
    3638# CSVPlugin is a sub-class of SplitTextFile.
    3739sub BEGIN {
    38     @CSVPlugin::ISA = ('MetadataRead', 'SplitTextFile');
     40    @CSVPlugin::ISA = ('MetadataRead', 'SplitTextFile', 'CSVFieldSeparator');
    3941}
    4042
     
    4244my $arguments =
    4345    [
    44       { 'name' => "separate_char",
    45     'desc' => "{CSVPlugin.separate_char}",
    46     'type' => "string",
    47     'deft' => "auto",
    48     'reqd' => "no" },
    4946      { 'name' => "process_exp",
    5047    'desc' => "{BaseImporter.process_exp}",
     
    9087    push(@{$hashArgOptLists->{"OptList"}}, $options);
    9188
     89    new CSVFieldSeparator($pluginlist, $inputargs, $hashArgOptLists);
    9290    my $self = new SplitTextFile($pluginlist, $inputargs, $hashArgOptLists);
    9391
     
    120118    my $separate_char = $self->{'separate_char'};
    121119    if ($separate_char =~ m/^auto$/i) {
    122     $separate_char = CSVSeparateChar::resolve_auto($csv_file_field_line,$self->{'plugin_type'},$self->{'outhandle'},$self->{'verbosity'});
     120    $separate_char = $self->resolve_auto($csv_file_field_line,$self->{'plugin_type'},$self->{'outhandle'},$self->{'verbosity'});
    123121    # Replace the 'auto' setting the resolved value (for use later on)
    124122    $self->{'separate_char'} = $separate_char;
Note: See TracChangeset for help on using the changeset viewer.