- Timestamp:
- Mar 28, 2007, 3:31:46 PM (18 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnczerodecoder.cpp
r426 r427 43 43 _fileName = path + fileName; 44 44 45 _out = 0; 45 46 reopen(); 46 47 } … … 49 50 //////////////////////////////////////////////////////////////////////// 50 51 bncZeroDecoder::~bncZeroDecoder() { 51 _out.close();52 delete _out; 52 53 } 53 54 … … 56 57 void bncZeroDecoder::reopen() { 57 58 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() ); 61 63 _fileDate = currDate; 62 64 } … … 67 69 void bncZeroDecoder::Decode(char* buffer, int bufLen) { 68 70 reopen(); 69 _out .write(buffer, bufLen);70 _out .flush();71 _out->write(buffer, bufLen); 72 _out->flush(); 71 73 } 72 74 -
trunk/BNC/bnczerodecoder.h
r426 r427 39 39 void reopen(); 40 40 QString _fileName; 41 std::ofstream 41 std::ofstream* _out; 42 42 QDate _fileDate; 43 43 };
Note:
See TracChangeset
for help on using the changeset viewer.