コード例 #1
0
ファイル: SDL_Main.cpp プロジェクト: bmosley/MilkyTracker
void SendFile(char *file)
{
	PPSystemString finalFile(file);
	PPSystemString* strPtr = &finalFile;
		
	PPEvent event(eFileDragDropped, &strPtr, sizeof(PPSystemString*));
	RaiseEventSerialized(&event);		
}
コード例 #2
0
ファイル: GZIP.cpp プロジェクト: TurBoss/makoureactor
QByteArray GZIP::compress(const char *ungzip, int size, int level, Strategy strategy)
{
	QString tempPath = QDir::tempPath() + "/qt_temp.gz";

	gzFile file2 = gzopen(tempPath.toLatin1(), gzMode("w", level, strategy).toLatin1());
	if(!file2) {
		return QByteArray();
	}
	gzwrite(file2, ungzip, size);
	gzclose(file2);
	QFile finalFile(tempPath);
	if(!finalFile.open(QIODevice::ReadOnly)) {
		return QByteArray();
	}

	QByteArray data = finalFile.readAll();
	finalFile.remove();

	return data;
}
コード例 #3
0
ファイル: savFinal.cpp プロジェクト: ingeekim/YukawaPlasma
void YukawaPlasma::savFinal(ofstream &logFile)
{
    //
    // YukawaPlasma class member function savFinal()
    //

    // Save final conditions
    cout << "Saving final conditions..." << endl;
    logFile << endl << "Saving final conditions..." << endl;

    //
    // save final velocities and poisions as iqp.out format
    // In-Gee Kim July, 2015
    //
    ofstream finalFile("initcb.out", ios::out);

    for (unsigned long i = 0; i < N_particles; i++) {
        if ( finalMode == 1 ) {
            // transform to the old format
            rx[i] += halfL;
            ry[i] += halfL;
            rz[i] += halfL;
        } // if ( finalMode == 1 )

        // save the information
        finalFile << scientific << setw(24) << setprecision(15)
            << vx[i] << " " << vy[i] << " " << vz[i] << " "
            << rx[i] << " " << ry[i] << " " << rz[i] << endl;
    } // for (unsigned long i = 0; i < N_particles; i++)

    finalFile.close();

    logFile << "Final velocities and positions are saved";
    if ( finalMode == 1 ) {
        logFile << " in old format" << endl;
    } else {
        logFile << " in new format" << endl;
    }

} // end of YukawaPlasma::savFinal()