Ignore:
Timestamp:
2001-01-29T14:54:58+13:00 (23 years ago)
Author:
sjboddie
Message:

Tidied up language support stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/gsdlunicode.cpp

    r1310 r1870  
    263263// setmapfile will cause loadmapfile to be called when conversion is
    264264// needed
    265 bool mapconvert::setmapfile (const text_t &thegsdlhome, const text_t &theencoding,
    266                  unsigned short theabsentc) {
     265bool mapconvert::setmapfile (const text_t &themapfile, unsigned short theabsentc) {
    267266  // check to see if the mapfile has been already loaded
    268   if (mapdata.loaded && gsdlhome == thegsdlhome &&
    269       encoding == theencoding && absentc == theabsentc)
    270     return true;
     267  if (mapdata.loaded && mapfile == themapfile && absentc == theabsentc) return true;
    271268
    272269  unloadmapfile ();
    273   gsdlhome = thegsdlhome;
    274   encoding = theencoding;
     270  mapfile = themapfile;
    275271  absentc = theabsentc;
    276272 
     
    281277
    282278// loadmapfile should be called before any conversion is done
    283 bool mapconvert::loadmapfile (const text_t &thegsdlhome,
    284                   const text_t &theencoding,
     279bool mapconvert::loadmapfile (const text_t &themapfile,
    285280                  unsigned short theabsentc) {
    286281  FILE *mapfilein = (FILE *)NULL;
    287282
    288283  // check to see if the mapfile has been already loaded
    289   if (mapdata.loaded && gsdlhome == thegsdlhome &&
    290       encoding == theencoding && absentc == theabsentc)
    291     return true;
     284  if (mapdata.loaded && mapfile == themapfile && absentc == theabsentc) return true;
    292285
    293286  unloadmapfile ();
    294   gsdlhome = thegsdlhome;
    295   encoding = theencoding;
     287  mapfile = themapfile;
    296288  absentc = theabsentc;
    297289
    298290  // open the map file
    299   text_t filename = filename_cat (gsdlhome, "unicode");
    300   filename = filename_cat (filename, encoding);
    301   filename += ".ump";
    302   char *cfilename = filename.getcstr();
     291  char *cfilename = mapfile.getcstr();
    303292  if (cfilename == (char *)NULL) return false;
    304293  mapfilein = fopen(cfilename, "rb");
     
    359348unsigned short mapconvert::convert (unsigned short c) {
    360349  if (!mapdata.loaded) {
    361     if (!gsdlhome.empty() && !encoding.empty() &&
    362     loadmapfile (gsdlhome, encoding, absentc)) {
     350    if (!mapfile.empty() && loadmapfile (mapfile, absentc)) {
    363351      // do nothing, successfully loaded database
    364352    } else return absentc;
Note: See TracChangeset for help on using the changeset viewer.