Changeset 2882 in ntrip for trunk/BNC/bncantex.cpp


Ignore:
Timestamp:
Jan 26, 2011, 11:22:21 AM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncantex.cpp

    r2881 r2882  
    5353////////////////////////////////////////////////////////////////////////////
    5454bncAntex::~bncAntex() {
     55  QMapIterator<QString, t_antMap*> it(_maps);
     56  while (it.hasNext()) {
     57    it.next();
     58    delete it.value();
     59  }
    5560}
    5661
    5762//
    5863////////////////////////////////////////////////////////////////////////////
    59 void bncAntex::readFile(const QString& fileName) {
     64t_irc bncAntex::readFile(const QString& fileName) {
    6065
    6166  QFile inFile(fileName);
     
    6671  while ( !in.atEnd() ) {
    6772    QString line = in.readLine();
     73 
     74    t_antMap* newMap = 0;
     75    if      (line.indexOf("START OF ANTENNA") == 60) {
     76      if (newMap) {
     77        delete newMap;
     78        return failure;
     79      }
     80      else {
     81        newMap = new t_antMap();
     82      }
     83    }
    6884
     85    else if (line.indexOf("END OF ANTENNA") == 60) {
     86      if (newMap) {
     87        _maps[newMap->antName] = newMap;
     88        newMap = 0;
     89      }
     90      else {
     91        return failure;
     92      }
     93    }
    6994  }
     95
     96  return success;
    7097}
Note: See TracChangeset for help on using the changeset viewer.