Changeset 427 in ntrip


Ignore:
Timestamp:
Mar 28, 2007, 3:31:46 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnczerodecoder.cpp

    r426 r427  
    4343  _fileName = path + fileName;
    4444
     45  _out = 0;
    4546  reopen();
    4647}
     
    4950////////////////////////////////////////////////////////////////////////
    5051bncZeroDecoder::~bncZeroDecoder() {
    51   _out.close();
     52  delete _out;
    5253}
    5354
     
    5657void bncZeroDecoder::reopen() {
    5758  QDate currDate = QDate::currentDate();
    58   if (!_fileDate.isValid() || _fileDate != currDate) {
    59     _out.close();
    60     _out.open( (_fileName + "_" + currDate.toString("yyMMdd")).toAscii().data());
     59  if (!_out || _fileDate != currDate) {
     60    delete _out;
     61    _out = new ofstream( (_fileName + "_" +
     62                          currDate.toString("yyMMdd")).toAscii().data() );
    6163    _fileDate = currDate;
    6264  }
     
    6769void bncZeroDecoder::Decode(char* buffer, int bufLen) {
    6870  reopen();
    69   _out.write(buffer, bufLen);
    70   _out.flush();
     71  _out->write(buffer, bufLen);
     72  _out->flush();
    7173}
    7274
  • trunk/BNC/bnczerodecoder.h

    r426 r427  
    3939    void reopen();
    4040    QString        _fileName;
    41     std::ofstream  _out;
     41    std::ofstream* _out;
    4242    QDate          _fileDate;
    4343};
Note: See TracChangeset for help on using the changeset viewer.