Changeset 450 for trunk


Ignore:
Timestamp:
02/15/05 20:06:11 (20 years ago)
Author:
kil064
Message:

make format case insensitive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDWriter.cc

    r442 r450  
    6060  cFormat = format;
    6161//
    62   if (cFormat == "MS2") {
     62  String t(cFormat);
     63  t.upcase();
     64  if (t== "MS2") {
    6365    cWriter = new PKSMS2writer();
    64   } else if (cFormat == "SDFITS") {
     66  } else if (t== "SDFITS") {
    6567    cWriter = new PKSSDwriter();
    66   } else if (cFormat == "FITS") {
    67     cWriter = 0;
    68   } else if (cFormat == "ASCII") {
    69     cWriter = 0;
     68  } else if (t== "FITS") {
     69    cWriter = 0;
     70  } else if (t== "ASCII") {
     71    cWriter = 0;
     72  } else {
     73    throw (AipsError("Unrecognized Format"));
    7074  }
    7175}
     
    9094  if (format != cFormat) {
    9195    if (cWriter) delete cWriter;
    92 //
    93     cFormat = format;
    94     if (cFormat == "MS2") {
    95       cWriter = new PKSMS2writer();
    96     } else if (cFormat == "SDFITS") {
    97       cWriter = new PKSSDwriter();
    98     } else if (cFormat == "FITS") {
    99       cWriter = 0;
    100     } else if (cFormat == "ASCII") {
    101       cWriter = 0;
    102     }
     96  }
     97//
     98  cFormat = format;
     99  String t(cFormat);
     100  t.upcase();
     101  if (t== "MS2") {
     102    cWriter = new PKSMS2writer();
     103  } else if (t== "SDFITS") {
     104    cWriter = new PKSSDwriter();
     105  } else if (t== "FITS") {
     106    cWriter = 0;
     107  } else if (t== "ASCII") {
     108    cWriter = 0;
     109  } else {
     110    throw (AipsError("Unrecognized Format"));
    103111  }
    104112  return 0;
Note: See TracChangeset for help on using the changeset viewer.