Changeset 1065 in ntrip for trunk/BNS/bnscaster.cpp


Ignore:
Timestamp:
Aug 27, 2008, 12:09:31 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnscaster.cpp

    r1064 r1065  
    2626  _outSocket          = 0;
    2727  _outSocketOpenTrial = 0;
     28
     29  QSettings settings;
     30
     31  QIODevice::OpenMode oMode;
     32  if (Qt::CheckState(settings.value("fileAppend").toInt()) == Qt::Checked) {
     33    oMode = QIODevice::WriteOnly | QIODevice::Unbuffered | QIODevice::Append;
     34  }
     35  else {
     36    oMode = QIODevice::WriteOnly | QIODevice::Unbuffered;
     37  }
     38
     39  QString outFileName = settings.value("outFile").toString();
     40  if (outFileName.isEmpty()) {
     41    _outFile   = 0;
     42    _outStream = 0;
     43  }
     44  else {
     45    _outFile = new QFile(outFileName);
     46    if (_outFile->open(oMode)) {
     47      _outStream = new QTextStream(_outFile);
     48    }
     49  }
    2850}
    2951
     
    3254t_bnscaster::~t_bnscaster() {
    3355  delete _outSocket;
     56  delete _outStream;
     57  delete _outFile;
    3458}
    3559
     
    101125  }
    102126}
     127
     128// Print Ascii Output
     129////////////////////////////////////////////////////////////////////////////
     130void t_bnscaster::printAscii(const QString& line) {
     131  if (_outStream) {
     132    *_outStream << line;
     133     _outStream->flush();
     134  }
     135}
Note: See TracChangeset for help on using the changeset viewer.