Show
Ignore:
Timestamp:
10.12.2015 12:19:20 (4 years ago)
Author:
jmt12
Message:

Continuing to refactor driver code to move shared code up to parent classes. Have all the basic drivers done...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/tdb/trunk/perllib/DBDrivers/GDBM.pm

    r30342 r30347  
    2929use strict; 
    3030 
     31BEGIN 
     32{ 
     33    if (!defined $ENV{'GSDLHOME'} || !defined $ENV{'GSDLOS'}) { 
     34        die("Error! Environment not prepared. Have you sourced setup.bash?\n"); 
     35    } 
     36} 
     37 
    3138# Libraries 
    3239use util; 
     
    4754    $self->{'keyread_executable'} = 'gdbmkeys'; 
    4855    $self->{'write_executable'} = 'txt2db'; 
     56    # Optional Support 
    4957    $self->{'supports_set'} = 1; 
    5058    bless($self, $class); 
     
    5967 
    6068# Handled by BaseDBDriver 
    61 # sub get_infodb_file_path(string, string) 
     69# sub get_infodb_file_path(string, string) => string 
    6270 
    6371# Handled by 70HyphenFormat 
     72# sub open_infodb_write_handle(string, string?) => filehandle 
    6473# sub close_infodb_write_handle(filehandle) => void 
    6574# sub delete_infodb_entry(filehandle, string) => void 
     
    7281# sub write_infodb_rawentry(filehandle, string, string) => void 
    7382 
    74  
    75 ## @function open_infodb_write_handle(string, string*) => filehandle 
    76 # 
    77 #  Handles legacy use of optional 'append' argument where '-append' is required 
    78 # 
    79 sub open_infodb_write_handle 
    80 { 
    81     my $self = shift(@_); 
    82     my $infodb_file_path = shift(@_); 
    83     my $opt_append = shift(@_); 
    84     my $infodb_file_handle; 
    85     if (defined $opt_append) { 
    86     if ($opt_append eq 'append') { 
    87         $opt_append = '-append'; 
    88     } 
    89     $infodb_file_handle = $self->SUPER::open_infodb_write_handle($infodb_file_path, $opt_append); 
    90     } 
    91     else 
    92     { 
    93     $infodb_file_handle = $self->SUPER::open_infodb_write_handle($infodb_file_path); 
    94     } 
    95     return $infodb_file_handle; 
    96 } 
    97 ## open_infodb_write_handle(string, string*) => filehandle ## 
    98  
    99831;