当前位置: 首页>>代码示例>>C++>>正文


C++ saveToFile函数代码示例

本文整理汇总了C++中saveToFile函数的典型用法代码示例。如果您正苦于以下问题:C++ saveToFile函数的具体用法?C++ saveToFile怎么用?C++ saveToFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了saveToFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: emit

void ScorerManager::parseConstraintGroup()
{
	//////////////////
    emit( message("Parse constraint group starts: ") );
	if ( this->otherPairs_.size() < 2)
	{
		emit( message("Parse pairs first!") );
		return;
	}

	///////////////////////
	groupRelations_.clear();
	for ( int i = 0; i < this->actualInputGraphs_.size(); ++i)
	{
		Structure::Graph * g = Structure::Graph::actualGraph( this->actualInputGraphs_[i] );
		GroupRelationDetector grd(g, i, this->normalizeCoef_, this->logLevel_);
		grd.detect(this->otherPairs_[i]);
		this->groupRelations_.push_back(grd.groupRelations_);
		if (this->logLevel_)
		{
			saveToFile("group_relation-" + QString::number(i) + ".txt", this->groupRelations_[i]);
			saveToFile("pair_relation-" + QString::number(i) + ".txt", this->otherPairs_[i]);
		}
	}	

    emit( message("Parse constraint group end. ") );
}
开发者ID:TzarIvan,项目名称:topo-blend,代码行数:27,代码来源:ScorerManager.cpp

示例2: saveToFile

void saveToFile(struct dirNode *root,FILE *fstore)
{
	if(root!=NULL)
	{
		//fwrite(&(root->fileDesc),sizeof(FileDescriptor),1,fstore);
		saveToFile(root->rightSibling,fstore);
		saveToFile(root->firstChild,fstore);
	}
	
}
开发者ID:RahulSinghDhek,项目名称:vfsgrp30,代码行数:10,代码来源:nAryTree.c

示例3: loadFromFile

void ofxPanel::setValue(float mx, float my, bool bCheck){

	if( ofGetFrameNum() - currentFrame > 1 ){
		bGrabbed = false;
		bGuiActive = false;
		return;
	}
	if( bCheck ){
		if( b.inside(mx, my) ){
			bGuiActive = true;

			if( my > b.y && my <= b.y + header ){
				bGrabbed = true;
				grabPt.set(mx-b.x, my-b.y);
			} else{
				bGrabbed = false;
			}

			if(loadBox.inside(mx - b.x, my - b.y)) {
				loadFromFile(filename);
			}
			if(saveBox.inside(mx - b.x, my - b.y)) {
				saveToFile(filename);
			}
		}
	} else if( bGrabbed ){
		b.x = mx - grabPt.x;
		b.y = my - grabPt.y;
	}
}
开发者ID:3snail,项目名称:openFrameworks,代码行数:30,代码来源:ofxPanel.cpp

示例4: QWidget

Notebook::Notebook(QWidget *parent) :
    QWidget(parent)
{
    setupUi(this);
    titleLine->setReadOnly(true);
    contentText->setReadOnly(true);
    cancelButton->hide();
    submitButton->hide();
    nextButton->setEnabled(false);
    previousButton->setEnabled(false);
    editButton->setEnabled(false);
    removeButton->setEnabled(false);

    dialog = new FindDialog;

    connect(addButton, SIGNAL(clicked()), this, SLOT(addNote()));
    connect(submitButton, SIGNAL(clicked()), this, SLOT(submitNote()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));
    connect(previousButton, SIGNAL(clicked()), this, SLOT(previous()));
    connect(editButton, SIGNAL(clicked()), this, SLOT(editContent()));
    connect(removeButton, SIGNAL(clicked()), this, SLOT(removeContent()));
    connect(findButton, SIGNAL(clicked()), this, SLOT(findTitle()));
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveToFile()));
    connect(loadButton, SIGNAL(clicked()), this, SLOT(loadFromFile()));
}
开发者ID:rmpalmer,项目名称:notebook,代码行数:26,代码来源:notebook.cpp

示例5: generator

void dsk::work() {
	std::cout << "======Begin dsk model======" << std::endl;
	double a = 0, b = 1, r;

    for(auto i = 0; i < bytes.size(); i++){
        generator(a,b,r);
		r >= p ? bytes.at(i) = 0:1;
    }

    bl = makeBlocks(Blocks, BlockSize, bytes);
	pr = new protocol(bl,code);
	pr->work(dsk::ProtocolType, dsk::PacketSize);
	std::stringstream res;
	for(UINT i = 1; i <= dsk::PacketSize; i+=5){
		pr->work(dsk::ProtocolType, i);
		res << pr->getResults() << "\n";
	}
	saveToFile(res.str());
	dsk::plot = pr->getPlot();
	dsk::delProbPlot = pr->getDelProbPlot();
	std::cout << "======End dsk model======" << std::endl;
	std::stringstream bits;
    for(auto value : bytes){
    	bits << value << " ";
    }
	std::string bitsName = "ErrorsStreamDSK.txt";
    std::ofstream f;
    f.open(bitsName);
    f.write(bits.str().c_str(), sizeof(char)*bits.str().size()); 
    f.close();
}
开发者ID:poriesto,项目名称:ModelChannel,代码行数:31,代码来源:dsk.cpp

示例6: loadFromFile

bool ofxPanel::setValue(float mx, float my, bool bCheck){

	if( !isGuiDrawing() ){
		bGrabbed = false;
		bGuiActive = false;
		return false;
	}
	if( bCheck ){
		if( b.inside(mx, my) ){
			bGuiActive = true;

			if( my > b.y && my <= b.y + header ){
				bGrabbed = true;
				grabPt.set(mx-b.x, my-b.y);
			} else{
				bGrabbed = false;
			}

			if(loadBox.inside(mx, my)) {
				loadFromFile(filename);
				ofNotifyEvent(loadPressedE,this);
				return true;
			}
			if(saveBox.inside(mx, my)) {
				saveToFile(filename);
				ofNotifyEvent(savePressedE,this);
				return true;
			}
		}
	} else if( bGrabbed ){
		setPosition(mx - grabPt.x,my - grabPt.y);
		return true;
	}
	return false;
}
开发者ID:pabloriera,项目名称:ofxComposer,代码行数:35,代码来源:ofxPanel.cpp

示例7: getSavingFileName

void PolicyEditor::save(){
  if (!_isModified)
    return;
  QString file_name;
  file_name = getSavingFileName(_filePath);
  saveToFile(file_name);
}
开发者ID:Hramchenko,项目名称:userdatadefence,代码行数:7,代码来源:PolicyEditor.cpp

示例8: saveToFile

void TlevelCreatorDlg::saveLevel() {
    if ( QMessageBox::question(this, tr("level not saved!"), tr("Level was changed and not saved!"),
			QMessageBox::Save, QMessageBox::Cancel) == QMessageBox::Save ) {
        saveToFile();
    } else
				levelSaved();
}
开发者ID:SeeLook,项目名称:nootka,代码行数:7,代码来源:tlevelcreatordlg.cpp

示例9: saveToFile

	void DemoKeeper::notifyEndDialog(common::OpenSaveFileDialog* _sender, bool _result)
	{
		mFileDialog->setVisible(false);
		if (!_result) return;

		if (mFileDialogSave)
		{
			std::string filename = mFileDialog->getFileName();
			size_t index = filename.find_first_of('.');
			if (index == std::string::npos)
				filename += ".xml";
			filename = mFileDialog->getCurrentFolder() + "/" + filename;

			saveToFile(filename);
		}
		else
		{
			ClearGraph();

			std::string filename = mFileDialog->getFileName();
			filename = mFileDialog->getCurrentFolder() + "/" + filename;

			loadFromFile(filename);
		}
	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:25,代码来源:DemoKeeper.cpp

示例10: switch

void PixelWidget::keyPressEvent(QKeyEvent *e)
{
    switch (e->key()) {
    case Qt::Key_Plus:
        increaseZoom();
        break;
    case Qt::Key_Minus:
        decreaseZoom();
        break;
    case Qt::Key_PageUp:
        setGridSize(m_gridSize + 1);
        break;
    case Qt::Key_PageDown:
        setGridSize(m_gridSize - 1);
        break;
    case Qt::Key_G:
        toggleGrid();
        break;
    case Qt::Key_C:
        if (e->modifiers() & Qt::ControlModifier)
            copyToClipboard();
        break;
    case Qt::Key_S:
        if (e->modifiers() & Qt::ControlModifier) {
            releaseKeyboard();
            saveToFile();
        }
        break;
    case Qt::Key_Control:
        grabKeyboard();
        break;
    }
}
开发者ID:BayTekGames,项目名称:apitrace,代码行数:33,代码来源:pixelwidget.cpp

示例11: createNodeArray

// encoder
void Huffman::encode()
{
	cout << "Begin encoding..." << endl;

	cout << "Open file..." << endl;
		inFile_.open(inFileName_.c_str(),ios::in);

		cout << "Calculating frequency of all ascii chars..." << endl;
		createNodeArray();
		cout << "Done!" << endl;
		inFile_.close();

	cout << "Creating Priority-Queue..." << endl;
	createPq();
	cout << "Done!" << endl;

	cout << "Creating Huffman-Tree..." << endl;
	createHuffmanTree();
	cout << "Done!" << endl;

	cout << "Calculating Huffman-Code..." << endl;
	calculateHuffmanCode();
	cout << "Done!" << endl;

	cout << "Saving to outputfile..." << endl;
	saveToFile();
	cout << "Done!" << endl;

	cout << "Ecoding finished!" << endl;
}
开发者ID:hayespan,项目名称:ds_hw,代码行数:31,代码来源:Huffman.cpp

示例12: saveToFile

octree_base<Container, PointT>::~octree_base ()
{
    root_->flushToDisk ();
    root_->saveIdx (false);
    saveToFile ();
    delete root_;
}
开发者ID:xhy20070406,项目名称:PCL,代码行数:7,代码来源:octree_base.hpp

示例13: recordingStopped

void EventRecorder::timeout()
{
    if (sessionTimer->isSynchronizing())
        return;

    if (autoStopRecord >= 0)
    {
        if((eventData.getRemainingTime().toString("h:mm:ss") == "0:00:00" && eventData.getEventType() == LTPackets::PRACTICE_EVENT) ||
            (eventData.getRemainingTime().toString("h:mm:ss") == "0:00:00" && eventData.getEventType() == LTPackets::QUALI_EVENT && eventData.getQualiPeriod() == 3) ||
            ((eventData.getRemainingTime().toString("h:mm:ss") == "0:00:00" || eventData.getCompletedLaps() == eventData.getEventInfo().laps) && eventData.getEventType() == LTPackets::RACE_EVENT))
    		++elapsedTimeToStop;

		if (elapsedTimeToStop >= (autoStopRecord * 60))
		{
			emit recordingStopped();
			stopRecording();
		}
    }

    if (autoSaveRecord > -1)
    {
        --autoSaveCounter;

        if (autoSaveCounter <= 0)
        {
            saveToFile("");
            autoSaveCounter = autoSaveRecord * 60;
        }
    }
}
开发者ID:HxCory,项目名称:f1lt,代码行数:30,代码来源:eventrecorder.cpp

示例14: r

void MainWindow::on_saveButton_clicked()
{
    int size = nc*3/4;
    char potentialFilename[]="out/potential-%1.txt";
    char concFilename[]="out/ni_ne-%1.txt";

    //Save potential
    QVector<double> r(size), potential(size);
    for (int i=0; i<size; ++i)
    {
        r[i] = r_array[i];
        potential[i] = phi[i];
    }
    saveToFile(r,potential,QString(potentialFilename).arg((t/dt)));

    //Save concentration of the electrons and ions
    QVector<double> /*r(size),*/ ne(size),ni(size);
    for (int i=0; i<size; ++i)
    {
        r[i] = r_array[i];
        ne[i] = srho[0][i];
        ni[i] = srho[1][i];
    }
    saveToFile2(r,ne,ni, QString(concFilename).arg((t/dt)));

}
开发者ID:andrusiak,项目名称:xpds1qt,代码行数:26,代码来源:mainwindow.cpp

示例15: saveToFile

void Highscores::add(Score s) {
  s.version = highscoreVersion;
  localScores.push_back(s);
  saveToFile(localScores, localPath);
  remoteScores.push_back(s);
  fileSharing.uploadHighscores(localPath);
}
开发者ID:akien-mga,项目名称:keeperrl,代码行数:7,代码来源:highscores.cpp


注:本文中的saveToFile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。