• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ save_data函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: save_data

string JabberMessageError::save()
{
    string res = Message::save();
    string s = save_data(jabberMessageErrorData, &data);
    if (!s.empty()){
        if (!res.empty())
            res += "\n";
        res += s;
    }
    return res;
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:11,代码来源:jabbermessage.cpp


示例2: save_data

string SMSClient::getConfig()
{
    string cfg = TCPClient::getConfig();
    string my_cfg = save_data(smsClientData, &data);
    if (!my_cfg.empty()){
        if (!cfg.empty())
            cfg += "\n";
        cfg += my_cfg;
    }
    return cfg;
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:11,代码来源:sms.cpp


示例3: deinit

static void deinit(void) {
	save_data();

	deinit_menu();
	deinit_main();
	deinit_info();

	window_destroy(window_menu);
	window_destroy(window_main);
	window_destroy(window_info);
}
开发者ID:cstrat,项目名称:tennis-pro,代码行数:11,代码来源:tennis_pro.c


示例4: cb_friend_request

static void cb_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length,
                              void *userdata)
{
    TOX_ERR_FRIEND_ADD err;
    tox_friend_add_norequest(m, public_key, &err);

    if (err != TOX_ERR_FRIEND_ADD_OK)
        fprintf(stderr, "tox_friend_add_norequest failed (error %d)\n", err);

    save_data(m, DATA_FILE);
}
开发者ID:SergeyDjam,项目名称:ToxBot,代码行数:11,代码来源:toxbot.c


示例5: save_data

void StringsEditor::on_languageSelector_comboBox_currentTextChanged(const QString &arg1)
{
    if (data_loading) { return; }
    save_data();
    current_lang = arg1.toStdString();
    data_loading = true;
    std::string path_new = FILEPATH + std::string("/lang/strings_ingame_") + arg1.toStdString() + std::string(".dat");
    load_language(path_new);
    fill_translation();
    data_loading = false;
}
开发者ID:Fordi,项目名称:rockbot,代码行数:11,代码来源:stringseditor.cpp


示例6: exit_toxbot

static void exit_toxbot(Tox *m)
{
    uint32_t numchats = tox_count_chatlist(m);

    if (numchats)
        exit_groupchats(m, numchats);

    save_data(m, DATA_FILE);
    tox_kill(m);
    exit(EXIT_SUCCESS);
}
开发者ID:SergeyDjam,项目名称:ToxBot,代码行数:11,代码来源:toxbot.c


示例7: evolve_network

void evolve_network(network *net) {
  FILE *fh, *fhtime;
  char msg[1024], outdir[1024], msg2[80];
  double dx = 1000./(net->npcent);
  double dt = dx/(net->c);  			// physical time-step (seconds)
  int n_steps = round((net->tmax)/dt);
  //int n_steps = 4;
  int n_skip = net->nskip;
  //int n_skip = 1;
  int n_curr = 0;
  printf("Simulating network for %f hours\nTime step is %f (in secs)\nTotal steps %d\n", (net->tmax)/3600., dt, n_steps);
  
  init_dump(net);
  
  while (1) {
#if NOISE
    split_step2(net, dx, n_curr*dt);  // note (dx = dtau)
    //printf("Uncomment to run with noise\n"); exit(1);	
#else
    memcpy(p_prev, net->link[0]->p, (net->link[0]->N)*sizeof(double));
    split_step2nonoise(net, dx, n_curr*dt);  // note (dx = dtau)
#endif
    if (ADIABATIC) adiabatic_rk4(net->link[0]->fx, dt);
    n_curr++;
    
    if (n_curr % n_skip == 0) {
      printf("t = %.8e min\n", n_curr*dt/60.);
      dump_current(net, n_curr*dt);
      save_adiabatic();

      if (ADIABATIC_SAVE) save_adiabatic_temporal();
      if (PIPE_SAVE) {	
        for (int n = 0; n < net->nlinks; n++){ 
          sprintf(msg, "%s/pipe_%03d/%s_%03d.txt", net->current_dir, n, net->dname, n_curr/n_skip);
          fh = fopen(msg, "w");
	  save_data(fh, net->link[n], net, n_curr*dt);
          fclose(fh);         
        }
        /*if (net->mglf != 0) {
          sprintf(outdir, "%s/network", net->current_dir);
          sprintf(msg, "%s/%s_%03d.png", outdir, net->dname, n_curr/n_skip);
          sprintf(msg2, "t = %.3f sec", n_curr*dt);
          mgl_draw_network(net, msg, msg2);
        }*/
      }
    }
    if (n_curr == n_steps) break; 
  }
  printf("t = %.8e min\n", n_curr*dt/60.);
  fhtime = fopen("params.txt", "a");
  fprintf(fhtime, "%e\t%e\t%e\n", n_curr*dt/3600., ((net->knot[1])->P)*0.000001, ovsq2*((net->link[0])->W_l - (net->link[0])->Wb_l)/(net->c) );
  fclose(fhtime);
}
开发者ID:urrfinjuss,项目名称:gas-network,代码行数:53,代码来源:evolve.c


示例8: save_data

void CDFFDJump::OnOK()
{
	if (modified_)
	{
		if (!check_data())
			return;

		save_data();
	}

	CDialog::OnOK();
}
开发者ID:AndrewWPhillips,项目名称:HexEdit,代码行数:12,代码来源:DFFDJUMP.cpp


示例9: load_data_or_init

static int load_data_or_init(Tox *m, char *path)
{
    data_file_name = path;

    if (load_data(m))
        return 1;

    if (save_data(m))
        return 1;

    return 0;
}
开发者ID:AndreasDriesen,项目名称:toxcore,代码行数:12,代码来源:nTox.c


示例10: terminate

static void terminate(int signal) {
    save_data(signal);
    running = FALSE;

    if (config.reader_thread.enabled) {
        // SIGUSR2 the reader thread to interrupt the recv() call
        config.reader_thread.enabled = FALSE;
        pthread_kill(config.reader_thread.thread, SIGUSR2);

        // As soon as reader thread is terminated, main() terminates the writer thread and wraps up
    }
}
开发者ID:dotdoom,项目名称:mukite,代码行数:12,代码来源:mukite.c


示例11: connect

bool accounts::modules_loaded() {
	OptionsI *options_i = (OptionsI *)core_i->get_interface(INAME_OPTIONS);
	if(options_i) options_i->add_page("Accounts", options = new AccountsOptions(this));
	connect(options, SIGNAL(applied()), this, SLOT(save_data()));

	read_data();

	if(account_list.size() == 0)
		options_i->show_options("Accounts");

	return true;
}
开发者ID:mtux,项目名称:sjae,代码行数:12,代码来源:accounts.cpp


示例12: save_data

void CDFFDUseStruct::OnOK()
{
	if (modified_)
	{
		if (!check_data())
			return;

		save_data();
	}

	CDialog::OnOK();
}
开发者ID:Andrew-Phillips,项目名称:HexEdit,代码行数:12,代码来源:DFFDUseStruct.cpp


示例13: LOG

void Tox_Dispatcher::save_save_data()
{
    std::string sdf = Platform::get_instance()->get_save_data_file();
    std::ofstream os;
    os.open(sdf, std::ios::out | std::ios::binary);
    if (os.good()) {
        LOG(INFO) << "Saving tox data";
        const size_t len = tox_get_savedata_size(tox);
        std::vector<uint8_t> save_data(len, 0);
        tox_get_savedata(tox, save_data.data());
        os.write((char *) save_data.data(), len);
    }
    os.close();
}
开发者ID:retuxx,项目名称:fltox,代码行数:14,代码来源:toxdispatcher.cpp


示例14: save

void CHelicopter::save(NET_Packet &output_packet)
{
    m_movement.save	(output_packet);
    m_body.save		(output_packet);
    m_enemy.save	(output_packet);
    output_packet.w_vec3(XFORM().c);
    output_packet.w_float(m_barrel_dir_tolerance);
    save_data		(m_use_rocket_on_attack, output_packet);
    save_data		(m_use_mgun_on_attack, output_packet);
    save_data		(m_min_rocket_dist, output_packet);
    save_data		(m_max_rocket_dist, output_packet);
    save_data		(m_min_mgun_dist, output_packet);
    save_data		(m_max_mgun_dist, output_packet);
    save_data		(m_time_between_rocket_attack, output_packet);
    save_data		(m_syncronize_rocket, output_packet);
}
开发者ID:Zen13L,项目名称:xray-16,代码行数:16,代码来源:Helicopter.cpp


示例15: evolve_network_balance

void evolve_network_balance(network *net, network *netb){
  FILE *fh, *fhtime;
  char msg[1024], outdir[1024], msg2[80];
  double dx = 1000./(net->npcent);
  double dt = dx/(net->c);  			// physical time-step (seconds)
  int n_steps = round((net->tmax)/dt);
  int n_skip = net->nskip;
  int n_curr = 0; net->curr_T = n_curr*dt; 
  printf("Simulating network for %f hours\nTime step is %f (in secs)\nTotal steps %d\n", (net->tmax)/3600., dt, n_steps);
  init_save_balance(net);
  while (1) {
    copy_network(net, netb);
    split_step2(net, dx, n_curr*dt);  // note (dx = dtau)
    n_curr++; net->curr_T = n_curr*dt;
    
    if (n_curr % n_skip == 0) {
      printf("t = %.3f min\n", n_curr*dt/60.);
      save_balance(net, netb, dt, dx);
      fhtime = fopen("temporal_flux.txt", "a");
      fprintf(fhtime, "%e\t", n_curr*dt);  
      for (int n = 0; n < net->nlinks; n++) {
	fprintf(fhtime, "%e\t%e\t%e\t", (net->link[n]->Fl), (net->link[n]->Fm), (net->link[n]->Fr)  );
      }
      fprintf(fhtime, "\n");  
      fclose(fhtime);

      fhtime = fopen("temporal_pressure.txt", "a");
      fprintf(fhtime, "%e\t", n_curr*dt);  
      for (int n = 0; n < net->nlinks; n++) {
        fprintf(fhtime, "%e\t%e\t%e\t",  0.000001*((net->link[n])->Pl),  0.000001*((net->link[n])->Pm),  0.000001*((net->link[n])->Pr) );
      } 
      fprintf(fhtime, "\n");  
      fclose(fhtime);

      for (int n = 0; n < net->nlinks; n++){ 
        /*sprintf(outdir, "%s/figures_%03d", net->current_dir, n);
        sprintf(msg, "%s/%s_%03d.png", outdir, net->dname, n_curr/n_skip);
        sprintf(msg2, "t = %.3f sec", n_curr*dt);
        mgl_draw_pipe(net->link[n], net, msg, msg2);*/
        sprintf(msg, "%s/pipe_%03d/%s_%03d.txt", net->current_dir, n, net->dname, n_curr/n_skip);
        fh = fopen(msg, "w");
	save_data(fh, net->link[n], net, n_curr*dt);
        fclose(fh);
      }
    }
    if (n_curr == n_steps) break; 
  }
  printf("t = %.3f min\n", n_curr*dt/60.);
}
开发者ID:urrfinjuss,项目名称:gas-network,代码行数:49,代码来源:evolve.c


示例16: generate_guid

void CGameSpawnConstructor::save_spawn				(LPCSTR name, LPCSTR output)
{
	CMemoryWriter					stream;

	m_spawn_header.m_version		= XRAI_CURRENT_VERSION;
	m_spawn_header.m_guid			= generate_guid();
	m_spawn_header.m_graph_guid		= game_graph().header().guid();
	m_spawn_header.m_spawn_count	= spawn_graph().vertex_count();
	m_spawn_header.m_level_count	= (u32)m_level_spawns.size();
	
	stream.open_chunk				(0);
	stream.w_u32					(m_spawn_header.m_version);
	save_data						(m_spawn_header.m_guid,stream);
	save_data						(m_spawn_header.m_graph_guid,stream);
	stream.w_u32					(m_spawn_header.m_spawn_count);
	stream.w_u32					(m_spawn_header.m_level_count);
	stream.close_chunk				();
	
	stream.open_chunk				(1);
	save_data						(spawn_graph(),stream);
	stream.close_chunk				();

	stream.open_chunk				(2);
	save_data						(m_level_points,stream);
	stream.close_chunk				();

	stream.open_chunk				(3);
	save_data						(m_patrol_path_storage,stream);
	stream.close_chunk				();

	stream.open_chunk				(4);
	m_game_graph->save				(stream);
	stream.close_chunk				();

	stream.save_to					(*spawn_name(output));
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:36,代码来源:game_spawn_constructor.cpp


示例17: save

void CWeapon::save(NET_Packet &output_packet)
{
	inherited::save	(output_packet);
	save_data		(iAmmoElapsed,					output_packet);
	save_data		(m_cur_scope, 					output_packet);
	save_data		(m_flagsAddOnState, 			output_packet);
	save_data		(m_ammoType,					output_packet);
	save_data		(m_zoom_params.m_bIsZoomModeNow,output_packet);
	save_data		(m_bRememberActorNVisnStatus,	output_packet);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:10,代码来源:Weapon.cpp


示例18: fopen

static Tox *load_tox(struct Tox_Options *options, char *path)
{
    FILE *fp = fopen(path, "rb");
    Tox *m = NULL;

    if (fp == NULL) {
        TOX_ERR_NEW err;
        m = tox_new(options, &err);

        if (err != TOX_ERR_NEW_OK) {
            fprintf(stderr, "tox_new failed with error %d\n", err);
            return NULL;
        }

        save_data(m, path);
        return m;
    }

    off_t data_len = file_size(path);

    if (data_len == 0) {
        fclose(fp);
        return NULL;
    }

    char data[data_len];

    if (fread(data, sizeof(data), 1, fp) != 1) {
        fclose(fp);
        return NULL;
    }

    TOX_ERR_NEW err;
    options->savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE;
    options->savedata_data = (uint8_t *) data;
    options->savedata_length = data_len;

    m = tox_new(options, &err);

    if (err != TOX_ERR_NEW_OK) {
        fprintf(stderr, "tox_new failed with error %d\n", err);
        return NULL;
    }

    fclose(fp);
    return m;
}
开发者ID:lugnsk,项目名称:ToxBot,代码行数:47,代码来源:toxbot.c


示例19: save

int save(struct node_st *tree, const char *construct, const char *data)
{
	FILE *fpc, *fpd;

	fpc = fopen(construct, "w");
	/* if error */

	fpd = fopen(data, "w");

	save_construct(tree, fpc);
	save_data(tree, fpd);

	fclose(fpd);
	fclose(fpc);

	return 0;
}
开发者ID:zyxstar,项目名称:exam_c,代码行数:17,代码来源:save2.c


示例20: save_data

/*!
 * \brief MainWindow::do_EPI_save
 */
void MainWindow::do_EPI_save(){
    if (DEBUG) cout << Q_FUNC_INFO << endl;

    if (EPI_coord_mean->size() != 0 && EPI_coord_SD->size() != 0){
        QString file_name = current_dir + "/" + "EPI__processed_"+EPI_box_select_signal->currentText()+".dat";

        if (!file_name.isEmpty()){
            //Save
            bool res = save_data(file_name, EPI_coord_mean, EPI_coord_SD);

            if (!res){
                    status_error("");
            }
            else{
                int n = EPI_DATA_LENGHT;
                string *string_list1 = new string[n];
                string *string_list2 = new string[n];

                string_list1[0] = EPI_DATA_ITEM01;  string_list2[0] = "";
                string_list1[1] = EPI_DATA_ITEM02;  string_list2[1] = "";
                string_list1[2] = EPI_DATA_ITEM03;  string_list2[2] = "";
                string_list1[3] = EPI_DATA_ITEM04;  string_list2[3] = "";
                string_list1[4] = EPI_DATA_ITEM05;  string_list2[4] = "";
                string_list1[5] = EPI_DATA_ITEM06;  string_list2[5] = "";
                string_list1[6] = EPI_DATA_ITEM07;  string_list2[6] = "";
                string_list1[7] = EPI_DATA_ITEM08;  string_list2[7] = "";
                string_list1[8] = EPI_DATA_ITEM09;  string_list2[8] = "";
                string_list1[9] = EPI_DATA_ITEM10;  string_list2[9] = "";

                file_name.remove(".dat");
                file_name.append("__data.dat");
                res = save_sup_data(file_name, string_list1, string_list2, n);
                delete[] string_list1;
                delete[] string_list2;
            }
        }
        else{
            status_error("");
        }
    }
    else{
        status_error("");
    }
}
开发者ID:sgarnotel,项目名称:MRiCP,代码行数:47,代码来源:mainwindow_EPI.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ save_extension函数代码示例发布时间:2022-05-30
下一篇:
C++ save_config函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap