您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ update_dir函数代码示例

51自学网 2021-06-03 09:15:14
  C++
这篇教程C++ update_dir函数代码示例写得很实用,希望能帮到您。

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

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

示例1: update_file_list

void EditorFileDialog::_go_up() {	dir_access->change_dir("..");	update_file_list();	update_dir();	_push_history();}
开发者ID:Zylann,项目名称:godot,代码行数:7,


示例2: update_dir

void FileDialog::set_current_dir(const String& p_dir) {		dir_access->change_dir(p_dir);	update_dir();	invalidate();	}
开发者ID:zz676,项目名称:godot,代码行数:7,


示例3: update_dir

void EditorFileDialog::set_current_dir(const String &p_dir) {	dir_access->change_dir(p_dir);	update_dir();	invalidate();	//_push_history();}
开发者ID:Zylann,项目名称:godot,代码行数:7,


示例4: invalidate

void FileDialog::_dir_entered(String p_dir) {	dir_access->change_dir(p_dir);	file->set_text("");	invalidate();	update_dir();}
开发者ID:Ranakhamis,项目名称:godot,代码行数:7,


示例5: ERR_FAIL_INDEX

void FileDialog::set_access(Access p_access) {	ERR_FAIL_INDEX(p_access,3);	if (access==p_access)		return;	memdelete( dir_access );	switch(p_access) {		case ACCESS_FILESYSTEM: {			dir_access = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);		} break;		case ACCESS_RESOURCES: {			dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES);		} break;		case ACCESS_USERDATA: {			dir_access = DirAccess::create(DirAccess::ACCESS_USERDATA);		} break;	}	access=p_access;	_update_drives();	invalidate();	update_filters();	update_dir();}
开发者ID:zz676,项目名称:godot,代码行数:26,


示例6: mutex

    bool Application::updating()    {#ifdef _WIN32        CHandle mutex(::CreateSemaphore(NULL, 0, 1, updater_singlton_mutex_name.c_str()));        if (ERROR_ALREADY_EXISTS == ::GetLastError())            return true;                CRegKey key_software;        if (ERROR_SUCCESS != key_software.Open(HKEY_CURRENT_USER, L"Software"))            return false;        CRegKey key_product;        if (ERROR_SUCCESS != key_product.Create(key_software, (const wchar_t*) product_name.utf16()))            return false;        wchar_t version_buffer[1025];        unsigned long len = 1024;        if (ERROR_SUCCESS != key_product.QueryStringValue(L"update_version", version_buffer, &len))            return false;        QString version_update = QString::fromUtf16((const ushort*) version_buffer);        core::tools::version_info info_current;        core::tools::version_info info_update(version_update.toStdString());        if (info_current < info_update)        {            wchar_t this_module_name[1024];            if (!::GetModuleFileName(0, this_module_name, 1024))                return false;            QDir dir = QFileInfo(QString::fromUtf16((const ushort*) this_module_name)).absoluteDir();            if (!dir.cdUp())                return false;            QString update_folder = dir.absolutePath() + "/" + updates_folder_short  + "/" + version_update;            QDir update_dir(update_folder);            if (update_dir.exists())            {                QString setup_name = update_folder + "/" + installer_exe_name;                QFileInfo setup_info(setup_name);                if (!setup_info.exists())                    return false;                mutex.Close();                const auto command = QString("/"") + QDir::toNativeSeparators(setup_name) + "/"" + " " + update_final_command;                QProcess::startDetached(command);                return true;            }        }#endif //_WIN32        return false;    }
开发者ID:admhome,项目名称:icqdesktop,代码行数:59,


示例7: file_listbox_update

void file_listbox_update(FileListBox_t *box){    ListBox_t *listbox = (ListBox_t *) box;    listbox_clear(listbox);    update_dir(box->path, box->suffix, box, file_listbox_add_file);    listbox_sort(listbox);    listbox_highlight(listbox, 0);}
开发者ID:quackenbush,项目名称:nestalgia,代码行数:10,


示例8: ERR_FAIL_INDEX

void EditorFileDialog::_recent_selected(int p_idx) {	Vector<String> recentd = EditorSettings::get_singleton()->get_recent_dirs();	ERR_FAIL_INDEX(p_idx,recentd.size());	dir_access->change_dir(recent->get_item_metadata(p_idx));	update_file_list();	update_dir();	_push_history();}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:10,


示例9: update_dir

void FileDialog::set_current_file(const String &p_file) {	file->set_text(p_file);	update_dir();	invalidate();	int lp = p_file.find_last(".");	if (lp != -1) {		file->select(0, lp);		file->grab_focus();	}}
开发者ID:Ranakhamis,项目名称:godot,代码行数:11,


示例10: invalidate

void FileDialog::_make_dir_confirm() {	Error err = dir_access->make_dir( makedirname->get_text() );	if (err==OK) {		dir_access->change_dir(makedirname->get_text());		invalidate();		update_filters();		update_dir();	} else {		mkdirerr->popup_centered_minsize(Size2(250,50));	}}
开发者ID:zz676,项目名称:godot,代码行数:13,


示例11: create_laser

static void create_laser(int x, int y, int type){    laser_t *me;    int dir;    int count;        me = malloc(sizeof(*me));    me->x = x;    me->y = y;    me->type = type;    sl_list_init(&me->e);    sl_list_init(&me->lights);    dir = type >> 8;    count = 0;    printf("/n**********begin lights**********/n");    while (1)    {        int ground;        light_t *l;        if (count++ > 10000)            assert(!"failure to generate lights for laser.");        update_pos(&x, &y, dir);        ground = map[x + y * map_width];                if (x < 0 || y < 0 || x >= map_width || y >= map_height)            break;        if ((ground & 0xF000) != G_NORMAL)            break;        l = malloc(sizeof(*l));        l->x = x;        l->y = y;        l->dir = dir;        sl_list_init(&l->e);        sl_list_add_tail(&me->lights, &l->e);        printf("(%02d,%02d) ", x, y);        update_dir(ground, &dir);    }    printf("/n");}
开发者ID:patrick963534,项目名称:a517,代码行数:51,


示例12: update_file_list

void EditorFileDialog::_go_back(){	if (local_history_pos<=0) {		return;	}	local_history_pos--;	dir_access->change_dir(local_history[local_history_pos]);	update_file_list();	update_dir();	dir_prev->set_disabled(local_history_pos==0);	dir_next->set_disabled(local_history_pos==local_history.size()-1);}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:14,


示例13: invalidate

void EditorFileDialog::_make_dir_confirm() {	Error err = dir_access->make_dir( makedirname->get_text() );	if (err==OK) {		dir_access->change_dir(makedirname->get_text());		invalidate();		update_filters();		update_dir();		_push_history();	} else {		mkdirerr->popup_centered_minsize(Size2(250,50));	}	makedirname->set_text(""); // reset label}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:15,


示例14: memnew

//.........这里部分代码省略.........	fav_mv->set_v_size_flags(SIZE_EXPAND_FILL);	favorites = memnew( ItemList );	fav_mv->add_child(favorites);	favorites->connect("item_selected",this,"_favorite_selected");	recent = memnew( ItemList );	fav_vb->add_margin_child(TTR("Recent:"),recent,true);	recent->connect("item_selected",this,"_recent_selected");	VBoxContainer *item_vb = memnew( VBoxContainer );	list_hb->add_child(item_vb);	item_vb->set_h_size_flags(SIZE_EXPAND_FILL);	item_list = memnew( ItemList );	item_list->set_v_size_flags(SIZE_EXPAND_FILL);	item_vb->add_margin_child(TTR("Directories & Files:"),item_list,true);	HBoxContainer* filter_hb = memnew( HBoxContainer );	item_vb->add_child(filter_hb);	VBoxContainer *filter_vb = memnew( VBoxContainer );	filter_hb->add_child(filter_vb);	filter_vb->set_h_size_flags(SIZE_EXPAND_FILL);	preview_vb = memnew( VBoxContainer );	filter_hb->add_child(preview_vb);	CenterContainer *prev_cc = memnew( CenterContainer );	preview_vb->add_margin_child(TTR("Preview:"),prev_cc);	preview = memnew( TextureFrame );	prev_cc->add_child(preview);	preview_vb->hide();	file = memnew(LineEdit);	//add_child(file);	filter_vb->add_margin_child(TTR("File:"),file);	filter = memnew( OptionButton );	//add_child(filter);	filter_vb->add_margin_child(TTR("Filter:"),filter);	filter->set_clip_text(true);//too many extensions overflow it	dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES);	access=ACCESS_RESOURCES;	_update_drives();	connect("confirmed", this,"_action_pressed");	//cancel->connect("pressed", this,"_cancel_pressed");	item_list->connect("item_selected", this,"_item_selected",varray(),CONNECT_DEFERRED);	item_list->connect("item_activated", this,"_item_db_selected",varray());	dir->connect("text_entered", this,"_dir_entered");	file->connect("text_entered", this,"_file_entered");	filter->connect("item_selected", this,"_filter_selected");	confirm_save = memnew( ConfirmationDialog );	confirm_save->set_as_toplevel(true);	add_child(confirm_save);	confirm_save->connect("confirmed", this,"_save_confirm_pressed");	makedialog = memnew( ConfirmationDialog );	makedialog->set_title(TTR("Create Folder"));	VBoxContainer *makevb= memnew( VBoxContainer );	makedialog->add_child(makevb);	makedialog->set_child_rect(makevb);	makedirname = memnew( LineEdit );	makevb->add_margin_child(TTR("Name:"),makedirname);	add_child(makedialog);	makedialog->register_text_enter(makedirname);	makedialog->connect("confirmed",this,"_make_dir_confirm");	mkdirerr = memnew( AcceptDialog );	mkdirerr->set_text(TTR("Could not create folder."));	add_child(mkdirerr);	exterr = memnew( AcceptDialog );	exterr->set_text(TTR("Must use a valid extension."));	add_child(exterr);	//update_file_list();	update_filters();	update_dir();	set_hide_on_ok(false);	vbox=vbc;	invalidated=true;	if (register_func)		register_func(this);	preview_wheel_timeout=0;	preview_wheel_index=0;	preview_waiting=false;}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:101,


示例15: memnew

FileDialog::FileDialog() {	show_hidden_files = default_show_hidden_files;	mode_overrides_title = true;	VBoxContainer *vbc = memnew(VBoxContainer);	add_child(vbc);	mode = MODE_SAVE_FILE;	set_title(RTR("Save a File"));	HBoxContainer *hbc = memnew(HBoxContainer);	dir_up = memnew(ToolButton);	dir_up->set_tooltip(RTR("Go to parent folder"));	hbc->add_child(dir_up);	dir_up->connect("pressed", this, "_go_up");	hbc->add_child(memnew(Label(RTR("Path:"))));	dir = memnew(LineEdit);	hbc->add_child(dir);	dir->set_h_size_flags(SIZE_EXPAND_FILL);	refresh = memnew(ToolButton);	refresh->connect("pressed", this, "_update_file_list");	hbc->add_child(refresh);	drives = memnew(OptionButton);	hbc->add_child(drives);	drives->connect("item_selected", this, "_select_drive");	makedir = memnew(Button);	makedir->set_text(RTR("Create Folder"));	makedir->connect("pressed", this, "_make_dir");	hbc->add_child(makedir);	vbc->add_child(hbc);	tree = memnew(Tree);	tree->set_hide_root(true);	vbc->add_margin_child(RTR("Directories & Files:"), tree, true);	hbc = memnew(HBoxContainer);	hbc->add_child(memnew(Label(RTR("File:"))));	file = memnew(LineEdit);	file->set_stretch_ratio(4);	file->set_h_size_flags(SIZE_EXPAND_FILL);	hbc->add_child(file);	filter = memnew(OptionButton);	filter->set_stretch_ratio(3);	filter->set_h_size_flags(SIZE_EXPAND_FILL);	filter->set_clip_text(true); // too many extensions overflows it	hbc->add_child(filter);	vbc->add_child(hbc);	dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES);	access = ACCESS_RESOURCES;	_update_drives();	connect("confirmed", this, "_action_pressed");	tree->connect("cell_selected", this, "_tree_selected", varray(), CONNECT_DEFERRED);	tree->connect("item_activated", this, "_tree_item_activated", varray());	tree->connect("nothing_selected", this, "deselect_items");	dir->connect("text_entered", this, "_dir_entered");	file->connect("text_entered", this, "_file_entered");	filter->connect("item_selected", this, "_filter_selected");	confirm_save = memnew(ConfirmationDialog);	confirm_save->set_as_toplevel(true);	add_child(confirm_save);	confirm_save->connect("confirmed", this, "_save_confirm_pressed");	makedialog = memnew(ConfirmationDialog);	makedialog->set_title(RTR("Create Folder"));	VBoxContainer *makevb = memnew(VBoxContainer);	makedialog->add_child(makevb);	makedirname = memnew(LineEdit);	makevb->add_margin_child(RTR("Name:"), makedirname);	add_child(makedialog);	makedialog->register_text_enter(makedirname);	makedialog->connect("confirmed", this, "_make_dir_confirm");	mkdirerr = memnew(AcceptDialog);	mkdirerr->set_text(RTR("Could not create folder."));	add_child(mkdirerr);	exterr = memnew(AcceptDialog);	exterr->set_text(RTR("Must use a valid extension."));	add_child(exterr);	update_filters();	update_dir();	set_hide_on_ok(false);	vbox = vbc;	invalidated = true;	if (register_func)		register_func(this);//.........这里部分代码省略.........
开发者ID:Ranakhamis,项目名称:godot,代码行数:101,


示例16: update_file_list

void FileDialog::_go_up() {	dir_access->change_dir("..");	update_file_list();	update_dir();}
开发者ID:Ranakhamis,项目名称:godot,代码行数:6,


示例17: update_dir

void update_dir(const char * src_path, const char * dst_path, int rec_bucket, bool verbose) {    struct dirent **src_list = 0;    struct dirent **dst_list = 0;    int count_scr, count_dst, delta, i, j;    char *path_src_file=0, *path_dst_file=0;    count_scr = scandir(src_path, &src_list, dir_filter, alphasort);    if (count_scr<0) {        printf("Try to open %s, but:/n",src_path);        printf("ERROR: %s/n", strerror(errno));        exit(2);    }    count_dst = scandir(dst_path, &dst_list, dir_filter, alphasort);    if (count_dst <0) {        printf("Try to open %s, but:/n",dst_path);        printf("ERROR: %s/n", strerror(errno));        exit(2);    }    struct stat stat_src, stat_dst;    for (i=0,j=0; i<count_scr; i++) {        path_src_file = create_path(src_path, src_list[i]->d_name);        lstat(path_src_file, &stat_src);#ifndef _DIRENT_HAVE_D_TYPE        if (!(S_ISREG(stat_src.st_mode)||S_ISDIR(stat_src.st_mode)))            break;#endif        if (j+1 > count_dst)            delta = -1;        else            delta = strcmp(src_list[i]->d_name, dst_list[j]->d_name);        if (delta < 0) {                        // src not in dst. copy            path_dst_file = create_path(dst_path, src_list[i]->d_name);            if (S_ISREG(stat_src.st_mode)) { // copy file                copy_file(path_src_file, path_dst_file);                if (verbose)                    printf("Copy/t%s/t->/t%s/n",path_src_file,path_dst_file);            }            else {                          // create and copy subfolder                if (0 == mkdir(path_dst_file, stat_src.st_mode)) {                    if (rec_bucket > 1)                        update_dir(path_src_file, path_dst_file, rec_bucket - 1, verbose);                    else {                        if (verbose)                            printf("Reached recursion limit/n");                    }                }            }            free(src_list[i]);        }        else if (delta > 0) {            j++;                                // dst not in src. skip            i--;            path_dst_file = 0;        }        else if (delta == 0) {                  // src existiert in dst            path_dst_file = create_path(dst_path, dst_list[j]->d_name);            if (S_ISDIR(stat_src.st_mode)) { // subfolder                if (rec_bucket > 1)                    update_dir(path_src_file, path_dst_file, rec_bucket - 1, verbose);                else {                    if (verbose)                        printf("Reached recursion limit/n");                }            }            else {                              // copy newer file                lstat(path_dst_file, &stat_dst);                if (stat_dst.st_mtim.tv_sec < stat_src.st_mtim.tv_sec) {                    copy_file(path_src_file, path_dst_file);                    if (verbose)                        printf("Update/t%s/t->/t%s/n",path_src_file,path_dst_file);                }            }            free(src_list[i]);            free(dst_list[j]);            j++;        }        if (path_src_file)            free(path_src_file);        if (path_dst_file)            free(path_dst_file);    }    if (dst_list)        free(dst_list);    if (src_list)        free(src_list);}
开发者ID:Robotregent,项目名称:system-soft,代码行数:92,


示例18: memnew

FileDialog::FileDialog() {	show_hidden_files=true;	VBoxContainer *vbc = memnew( VBoxContainer );	add_child(vbc);	set_child_rect(vbc);	mode=MODE_SAVE_FILE;	set_title("Save a File");		dir = memnew(LineEdit);	HBoxContainer *pathhb = memnew( HBoxContainer );	pathhb->add_child(dir);	dir->set_h_size_flags(SIZE_EXPAND_FILL);	drives = memnew( OptionButton );	pathhb->add_child(drives);	drives->connect("item_selected",this,"_select_drive");	makedir = memnew( Button );	makedir->set_text("Create Folder");	makedir->connect("pressed",this,"_make_dir");	pathhb->add_child(makedir);		vbc->add_margin_child("Path:",pathhb);		tree = memnew(Tree);	tree->set_hide_root(true);	vbc->add_margin_child("Directories & Files:",tree,true);		file = memnew(LineEdit);	//add_child(file);	vbc->add_margin_child("File:",file);		filter = memnew( OptionButton );	//add_child(filter);	vbc->add_margin_child("Filter:",filter);	filter->set_clip_text(true);//too many extensions overflow it	dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES);	access=ACCESS_RESOURCES;	_update_drives();		connect("confirmed", this,"_action_pressed");	//cancel->connect("pressed", this,"_cancel_pressed");	tree->connect("cell_selected", this,"_tree_selected",varray(),CONNECT_DEFERRED);	tree->connect("item_activated", this,"_tree_db_selected",varray());	dir->connect("text_entered", this,"_dir_entered");	file->connect("text_entered", this,"_file_entered");	filter->connect("item_selected", this,"_filter_selected");		confirm_save = memnew( ConfirmationDialog );	confirm_save->set_as_toplevel(true);	add_child(confirm_save);		confirm_save->connect("confirmed", this,"_save_confirm_pressed");	makedialog = memnew( ConfirmationDialog );	makedialog->set_title("Create Folder");	VBoxContainer *makevb= memnew( VBoxContainer );	makedialog->add_child(makevb);	makedialog->set_child_rect(makevb);	makedirname = memnew( LineEdit );	makevb->add_margin_child("Name:",makedirname);	add_child(makedialog);	makedialog->register_text_enter(makedirname);	makedialog->connect("confirmed",this,"_make_dir_confirm");	mkdirerr = memnew( AcceptDialog );	mkdirerr->set_text("Could not create folder.");	add_child(mkdirerr);	exterr = memnew( AcceptDialog );	exterr->set_text("Must use a valid extension.");	add_child(exterr);	//update_file_list();	update_filters();	update_dir();	set_hide_on_ok(false);	vbox=vbc;	invalidated=true;	if (register_func)		register_func(this);	}
开发者ID:zz676,项目名称:godot,代码行数:94,


示例19: Error

//.........这里部分代码省略.........            step_out ( step , direc , base ) ;            step_err = trial_error ( tptr ) ;            }         }      else {  // Wild!  Reject parabolic and use golden ratio.         step = x3 + 1.618034 * (x3 - x2) ;         step_out ( step , direc , base ) ;         step_err = trial_error ( tptr ) ;         }/*   Shift three points and continue endless loop*/      x1 = x2 ;      x2 = x3 ;      x3 = step ;      previous_err = current_err ;      current_err = err ;      err = step_err ;      } // Endless stepping out loopBOUNDED:   step_out ( x2 , direc , base);//Leave coefs at min   if (x1 > x3) {  // We may have switched direction at start.      t1 = x1 ;    // Brent's method which follows assumes ordered parameter.      x1 = x3 ;      x3 = t1 ;      }   if (user_quit) {      update_dir ( x2 , direc ) ;// Make it be the actual dist moved      return -current_err ;      }/*--------------------------------------------------------------------------------   At this point we have bounded the minimum between x1 and x3.   Go to the refinement stage.  We use Brent's algorithm.--------------------------------------------------------------------------------*//*  Initialize prevdist, the distance moved on the previous step, to 0 so that  the 'if (fabs ( prevdist )  >  tol1)' encountered on the first iteration  below will fail, forcing a golden section the first time.  Also initialize  step to 0 to avoid a zealous compiler from pointing out that it was  referenced before being set.*/   prevdist = step = 0.0 ;/*   We always keep the minimum bracketed between xlow and xhigh.   xbest has the min function so far (or latest if tie).   xsecbest and xthirdbest are the second and third best.*/   xbest = xsecbest = xthirdbest = x2 ;   xlow = x1 ;   xhigh = x3 ;
开发者ID:evariste,项目名称:matlab_scripts,代码行数:67,



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


C++ update_display函数代码示例
C++ update_dc函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。