本文整理汇总了C++中saveToFile函数的典型用法代码示例。如果您正苦于以下问题:C++ saveToFile函数的具体用法?C++ saveToFile怎么用?C++ saveToFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了saveToFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: logg
void MonteCarlo::monteCarloAlgorithm() {
logg("start monteCarlo algorithm...");
Time st(boost::posix_time::microsec_clock::local_time());
calculateEnergy();
vector<cell*> listCells;
for (int i = 0; i < 100; i++) {
copySpaces(oldstate, cells);
fillList(&listCells, cells);
//cout<<listCells.size()<<endl;
if(listCells.size()>0){
executeList(&listCells,cells,oldstate);
}
manager->run();
manager->join_all();
listCells.clear();
}
Time end(boost::posix_time::microsec_clock::local_time());
TimeDuraction d = end - st;
duraction = d.total_milliseconds();
loggTime("time execution montecarlo algorithm: ",duraction);
saveToFile();
//drawSpace();
}
开发者ID:jackas007,项目名称:praca_magisterska,代码行数:26,代码来源:MonteCarlo.cpp
示例17: YieldAction
YieldAction EuclideanMenuSlice::handleConsoleResults()
{
std::list<std::string> line = console->getCurrCommand();
//No command means the Console killed itself.
if (line.empty() || line.front().empty()) {
return YieldAction();
}
//Else, the first item in the line is the command.
std::string cmd = line.front();
line.erase(line.begin());
//Switch on this command.
if (cmd == "clear") {
//For now, we treat this as an error.
console->appendCommandErrorMessage("Error: \"clear\" is not yet implemented.");
return YieldAction(YieldAction::Stack, console);
} else if (cmd == "additem") {
return addNewMenuItem(line);
} else if (cmd == "save") {
return saveToFile(line);
}
//Else, throw the command back to the terminal.
std::stringstream msg;
msg <<"Error, unexpected command: \"" <<cmd <<"\"";
console->appendCommandErrorMessage(msg.str());
return YieldAction(YieldAction::Stack, console);
}
开发者ID:sorlok,项目名称:Portentia,代码行数:30,代码来源:EuclideanMenuSlice.cpp
示例18: saveToFile
PluginInfoCache::~PluginInfoCache()
{
if (m_saveToFileIdle.isScheduled()) {
m_saveToFileIdle.cancel();
saveToFile();
}
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:7,代码来源:PluginInfoCache.cpp
示例19: fopen
int DriverCosmetics::saveToFile(const char* filename)
{
FILE* file = fopen(filename, "wb");
if(!file)
return -1;
return saveToFile(file);
};
开发者ID:someone972,项目名称:driver-level-editor,代码行数:7,代码来源:driver_cos.cpp
示例20: main
int main()
{
char input;
cout << "========= R E S T A U R A N T S I N C U P E R T I N O =========";
listHead *restaurants = new listHead(hashSize);
readFile(restaurants);
restaurants->getHashPtr()->printHashTableSequence();
// Display menu
displayMenu();
// Get user's input
input = getUserInput();
// While the user does not want to quit...
while (input != 'q')
{
// Call appropriate operation
operationManager(restaurants, input);
// Get user's input
input = getUserInput();
}
saveToFile(restaurants);
cout << "\n======================== T H A N K Y O U =========================";
}
开发者ID:waterboy2110,项目名称:TeamProjectCIS_22C_Final,代码行数:33,代码来源:main-withSave.cpp
注:本文中的saveToFile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论