pelican/output/src/DataBlobFile.cpp
// Adds a file to the output stream and opens it for writing.
Adds a file to the output stream and opens it for writing.
Adds a file to the output stream and opens it for writing .
void DataBlobFile::addFile(const QString& filename, const DataBlobFileType::DataBlobFileType_t& type )
{
    verbose(QString("Creating file %1").arg(filename));
    QFile* file = new QFile(filename);
    if (file->open(QIODevice::WriteOnly)) {
        QDataStream out(file);
        out.setVersion(QDataStream::Qt_4_0);
        _devices.append(file);
        _hetero.insert(file, ((type==DataBlobFileType::Heterogeneous)?true:false) );
        out << QString(DATABLOBFILE_MAGIC);
        out << DATABLOBFILE_VERSION;
        out << QSysInfo::ByteOrder;
        out << type;
    }
    else {
        std::cerr << "Cannot open file for writing: "
                  << filename.toStdString() << std::endl;
        delete file;
    }
}
void DataBlobFile :: addFile ( const QString & filename , const DataBlobFileType :: DataBlobFileType_t & type ) { verbose ( QString ( " " ) . arg ( filename ) ) ; QFile * file = new QFile ( filename ) ; if ( file -> open ( QIODevice :: WriteOnly ) ) { QDataStream out ( file ) ; out . setVersion ( QDataStream :: Qt_4_0 ) ; _devices . append ( file ) ; _hetero . insert ( file , ( ( type == DataBlobFileType :: Heterogeneous ) ? true : false ) ) ; out << QString ( DATABLOBFILE_MAGIC ) ; out << DATABLOBFILE_VERSION ; out << QSysInfo :: ByteOrder ; out << type ; } else { std :: cerr << " " << filename . toStdString ( ) << std :: endl ; delete file ; } }
Adds a file to the output stream and opens it for writing.
Adds a file to the output stream and opens it for writing .