Changeset 15680

Show
Ignore:
Timestamp:
23.05.2008 14:40:43 (11 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Now uses the new dbclass::getfileextension() function to avoid having GDBM-specific filename extension code scattered around.

Location:
gsdl/trunk/src/colservr
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/colservr/browsefilter.cpp

    r15587 r15680  
    2626#include "browsefilter.h" 
    2727#include "fileutil.h" 
    28 #include "gsdltools.h" 
    2928 
    3029 
     
    7675  if (!filterclass::init(logout)) return false; 
    7776 
     77  if (db_ptr == NULL) { 
     78    // most likely a configuration problem 
     79    logout << text_t2ascii  
     80       << "configuration error: browsefilter contains a null dbclass\n\n"; 
     81    return false; 
     82  } 
     83 
    7884  if (indexstem.empty()) { 
    7985    indexstem = collection; 
     
    8187  // get the filename for the database and make sure it exists 
    8288  db_filename = filename_cat(dbhome, "collect", collection, "index", "text", indexstem); 
    83  
    84   if (littleEndian()) db_filename += ".ldb"; 
    85   else db_filename += ".bdb"; 
    86  
     89  db_filename += db_ptr->getfileextension(); 
    8790  if (!file_exists(db_filename)) { 
    8891    logout << text_t2ascii 
  • gsdl/trunk/src/colservr/queryfilter.cpp

    r15595 r15680  
    2626#include "queryfilter.h" 
    2727#include "fileutil.h" 
    28 #include "gsdltools.h" 
    29 #include <assert.h> 
    3028 
    3129 
     
    404402  } 
    405403 
     404  if (db_ptr == NULL) { 
     405    // most likely a configuration problem 
     406    logout << text_t2ascii  
     407       << "configuration error: queryfilter contains a null dbclass\n\n"; 
     408    return false; 
     409  } 
     410 
    406411  // get the filename for the database and make sure it exists 
    407412  if (indexstem.empty()) { 
     
    409414  } 
    410415  db_filename = filename_cat(dbhome, "collect", collection, "index", "text", indexstem); 
    411  
    412   if (littleEndian()) db_filename += ".ldb"; 
    413   else db_filename += ".bdb"; 
    414  
     416  db_filename += db_ptr->getfileextension(); 
    415417  if (!file_exists(db_filename)) { 
    416418    logout << text_t2ascii 
  • gsdl/trunk/src/colservr/source.cpp

    r15617 r15680  
    2727#include "fileutil.h" 
    2828#include "OIDtools.h" 
    29 #include "gsdltools.h" 
    3029#include <assert.h> 
    3130 
     
    117116    collectdir = filename_cat (gsdlhome, "collect", collection); 
    118117  } 
    119    
     118 
     119  if (db_ptr == NULL) { 
     120    // most likely a configuration problem 
     121    logout << text_t2ascii  
     122       << "configuration error: queryfilter contains a null dbclass\n\n"; 
     123    return false; 
     124  } 
     125 
    120126  // get the filename for the database and make sure it exists 
    121127  if (indexstem.empty()) { 
     
    123129  } 
    124130  db_filename = filename_cat(dbhome, "collect", collection, "index", "text", indexstem); 
    125   if (littleEndian()) db_filename += ".ldb"; 
    126   else db_filename += ".bdb"; 
    127  
     131  db_filename += db_ptr->getfileextension(); 
    128132  if (!file_exists(db_filename)) { 
    129133    logout << text_t2ascii