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

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

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

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

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

示例1: wxT

void TopedApp::FinishSessionLog(){   LogFile.close();   wxString fullName;   fullName << tpdLogDir << wxT("/tpd_previous.log");   wxFileName* lFN = new wxFileName(fullName.c_str());   lFN->Normalize();   assert(lFN->IsOk());   wxRenameFile(logFileName.c_str(), lFN->GetFullPath());   delete lFN;}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:11,


示例2: RenameFile

 bool RenameFile(const wxString& src, const wxString& dst) {     wxFileName fname1(Manager::Get()->GetMacrosManager()->ReplaceMacros(src));     wxFileName fname2(Manager::Get()->GetMacrosManager()->ReplaceMacros(dst));     NormalizePath(fname1, wxEmptyString);     NormalizePath(fname2, wxEmptyString);     if (!SecurityAllows(_T("RenameFile"), wxString::Format(_T("%s -> %s"),                                     fname1.GetFullPath().c_str(), fname2.GetFullPath().c_str())))         return false;     if (!wxFileExists(fname1.GetFullPath())) return false;     return wxRenameFile(fname1.GetFullPath(),                         fname2.GetFullPath()); }
开发者ID:DowerChest,项目名称:codeblocks,代码行数:13,


示例3: MoveFile

// move file from source to dst, dst will be deleted if exists, dirs aren't created!bool MoveFile(const wxString& src, const wxString& dst){	//delete destination file	if (wxFileExists(dst)) {		wxRemoveFile(dst);	}	//rename file	if (wxRenameFile(src, dst)) {		return true;	}	// rename failed, try to copy + delete	return wxCopyFile(src, dst) && wxRemoveFile(src);}
开发者ID:OursDesCavernes,项目名称:springlobby,代码行数:14,


示例4: wxLogStderr

CLogManager::CLogManager() :wxLogStderr(){    m_pLock = new wxCriticalSection();    wxASSERT(m_pLock);    if (wxFileExists(wxT("BOINC-Sentinels-Valkyrie.log")))    {        wxRenameFile(wxT("BOINC-Sentinels-Valkyrie.log"), wxT("BOINC-Sentinels-Valkyrie.bak"), true);    }    m_pFile = new wxFFile(wxT("BOINC-Sentinels-Valkyrie.log"), wxT("a"));    m_fp = m_pFile->fp();}
开发者ID:romw,项目名称:boincsentinels,代码行数:14,


示例5: time

void TopedApp::SaveIgnoredCrashLog(){    time_t timeNow = time(NULL);    tm* broken_time = localtime(&timeNow);    char* btm = DEBUG_NEW char[256];    strftime(btm, 256, "_%y%m%d_%H%M%S", broken_time);    wxString fullName;    fullName << tpdLogDir + wxT("/crash") + wxString(btm, wxConvUTF8) + wxT(".log");    wxFileName* lFN = DEBUG_NEW wxFileName(fullName.c_str());    delete [] btm;    lFN->Normalize();    assert(lFN->IsOk());    wxRenameFile(logFileName.c_str(), lFN->GetFullPath());    delete lFN;}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:15,


示例6: cellFsRename

int cellFsRename(u32 from_addr, u32 to_addr){	const wxString& ps3_from = Memory.ReadString(from_addr);	const wxString& ps3_to = Memory.ReadString(to_addr);	wxString from;	wxString to;	Emu.GetVFS().GetDevice(ps3_from, from);	Emu.GetVFS().GetDevice(ps3_to, to);	sys_fs.Log("cellFsRename(from: %s, to: %s)", from.mb_str(), to.mb_str());	if(!wxFileExists(from)) return CELL_ENOENT;	if(wxFileExists(to)) return CELL_EEXIST;	if(!wxRenameFile(from, to)) return CELL_EBUSY; // (TODO: RenameFile(a,b) = CopyFile(a,b) + RemoveFile(a), therefore file "a" will not be removed if it is opened)	return CELL_OK;}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:15,


示例7: wxLogSysError

bool wxTempFile::Commit(){    m_file.Close();    if ( wxFile::Exists(m_strName) && wxRemove(m_strName) != 0 ) {        wxLogSysError(_("can't remove file '%s'"), m_strName.c_str());        return false;    }    if ( !wxRenameFile(m_strTemp, m_strName)  ) {        wxLogSysError(_("can't commit changes to file '%s'"), m_strName.c_str());        return false;    }    return true;}
开发者ID:Toonerz,项目名称:project64,代码行数:16,


示例8: RenameFile

    bool RenameFile()    {        CPPUNIT_ASSERT(m_file.FileExists());        wxLogDebug("Renaming %s=>%s", m_file.GetFullPath(), m_new.GetFullPath());        bool ret = wxRenameFile(m_file.GetFullPath(), m_new.GetFullPath());        if (ret)        {            m_old = m_file;            m_file = m_new;            m_new = RandomName();        }        return ret;    }
开发者ID:hazeeq090576,项目名称:wxWidgets,代码行数:16,


示例9: wxRenameFile

bool mmAttachmentManage::RelocateAllAttachments(const wxString& RefType, int OldRefId, int NewRefId){	auto attachments = Model_Attachment::instance().find(Model_Attachment::DB_Table_ATTACHMENT_V1::REFTYPE(RefType), Model_Attachment::REFID(OldRefId));    wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + m_PathSep + RefType + m_PathSep;	for (auto &entry : attachments)	{		wxString NewFileName = entry.FILENAME;		NewFileName.Replace(entry.REFTYPE + "_" + wxString::Format("%i", entry.REFID), entry.REFTYPE + "_" + wxString::Format("%i", NewRefId));		wxRenameFile(AttachmentsFolder + entry.FILENAME, AttachmentsFolder + NewFileName);		entry.REFID = NewRefId;		entry.FILENAME = NewFileName;		Model_Attachment::instance().save(attachments);	}	return true;}
开发者ID:unrealps,项目名称:moneymanagerex,代码行数:16,


示例10: Disable

void CIP2Country::DownloadFinished(uint32 result){	if (result == HTTP_Success) {		Disable();		// download succeeded. Switch over to new database.		wxString newDat = m_DataBasePath + wxT(".download");		// Try to unpack the file, might be an archive		wxWCharBuffer dataBaseName = m_DataBaseName.wc_str();		const wxChar* geoip_files[] = {			dataBaseName,			NULL		};		if (UnpackArchive(CPath(newDat), geoip_files).second == EFT_Error) {			AddLogLineC(_("Download of GeoIP.dat file failed, aborting update."));			return;		}		if (wxFileExists(m_DataBasePath)) {			if (!wxRemoveFile(m_DataBasePath)) {				AddLogLineC(CFormat(_("Failed to remove %s file, aborting update.")) % m_DataBaseName);				return;			}		}		if (!wxRenameFile(newDat, m_DataBasePath)) {			AddLogLineC(CFormat(_("Failed to rename %s file, aborting update.")) % m_DataBaseName);			return;		}		Enable();		if (m_geoip) {			AddLogLineN(CFormat(_("Successfully updated %s")) % m_DataBaseName);		} else {			AddLogLineC(_("Error updating GeoIP.dat"));		}	} else if (result == HTTP_Skipped) {		AddLogLineN(CFormat(_("Skipped download of %s, because requested file is not newer.")) % m_DataBaseName);	} else {		AddLogLineC(CFormat(_("Failed to download %s from %s")) % m_DataBaseName % thePrefs::GetGeoIPUpdateUrl());		// if it failed and there is no database, turn it off		if (!wxFileExists(m_DataBasePath)) {			thePrefs::SetGeoIPEnabled(false);		}	}}
开发者ID:Artoria2e5,项目名称:amule-dlp,代码行数:47,


示例11: wxASSERT

void wxFileCtrl::OnListEndLabelEdit( wxListEvent &event ){    wxFileData *fd = (wxFileData*)event.m_item.m_data;    wxASSERT( fd );    if ((event.GetLabel().empty()) ||            (event.GetLabel() == _(".")) ||            (event.GetLabel() == _("..")) ||            (event.GetLabel().First( wxFILE_SEP_PATH ) != wxNOT_FOUND))    {        wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR );        dialog.ShowModal();        event.Veto();        return;    }    wxString new_name( wxPathOnly( fd->GetFilePath() ) );    new_name += wxFILE_SEP_PATH;    new_name += event.GetLabel();    wxLogNull log;    if (wxFileExists(new_name))    {        wxMessageDialog dialog(this, _("File name exists already."), _("Error"), wxOK | wxICON_ERROR );        dialog.ShowModal();        event.Veto();    }    if (wxRenameFile(fd->GetFilePath(),new_name))    {        fd->SetNewName( new_name, event.GetLabel() );        ignoreChanges = true;        SetItemState( event.GetItem(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );        ignoreChanges = false;        UpdateItem( event.GetItem() );        EnsureVisible( event.GetItem() );    }    else    {        wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR );        dialog.ShowModal();        event.Veto();    }}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:47,


示例12: wxFileName

bool TREEPROJECT_ITEM::Rename( const wxString& name, bool check ){    // this is broken & unsafe to use on linux.    if( m_Type == TREE_DIRECTORY )        return false;    if( name.IsEmpty() )        return false;    const wxString  sep = wxFileName().GetPathSeparator();    wxString        newFile;    wxString        dirs = GetDir();    if( !dirs.IsEmpty() && GetType() != TREE_DIRECTORY )        newFile = dirs + sep + name;    else        newFile = name;    if( newFile == GetFileName() )        return false;    wxString    ext = TREE_PROJECT_FRAME::GetFileExt( GetType() );    wxRegEx     reg( wxT( "^.*//" ) + ext + wxT( "$" ), wxRE_ICASE );    if( check && !ext.IsEmpty() && !reg.Matches( newFile ) )    {        wxMessageDialog dialog( m_parent, _(            "Changing file extension will change file type./n Do you want to continue ?" ),            _( "Rename File" ),            wxYES_NO | wxICON_QUESTION );        if( wxID_YES != dialog.ShowModal() )            return false;    }    if( !wxRenameFile( GetFileName(), newFile, false ) )    {        wxMessageDialog( m_parent, _( "Unable to rename file ... " ),                         _( "Permission error ?" ), wxICON_ERROR | wxOK );        return false;    }    SetFileName( newFile );    return true;}
开发者ID:pointhi,项目名称:kicad-source-mirror,代码行数:47,


示例13: wxRemoveFile

void t4p::ExplorerModifyActionClass::BackgroundWork() {    wxFileName parentDir;    wxString name;    bool totalSuccess = true;    std::vector<wxFileName> dirsDeleted;    std::vector<wxFileName> dirsNotDeleted;    std::vector<wxFileName> filesDeleted;    std::vector<wxFileName> filesNotDeleted;    if (t4p::ExplorerModifyActionClass::DELETE_FILES_DIRS == Action) {        std::vector<wxFileName>::iterator d;        for (d = Dirs.begin(); d != Dirs.end(); ++d) {            bool success = t4p::RecursiveRmDir(d->GetPath());            if (success) {                wxFileName wxFileName;                wxFileName.AssignDir(d->GetPath());                dirsDeleted.push_back(wxFileName);            } else {                wxFileName wxFileName;                wxFileName.AssignDir(d->GetPath());                dirsNotDeleted.push_back(wxFileName);            }            totalSuccess &= success;        }        std::vector<wxFileName>::iterator f;        for (f = Files.begin(); f != Files.end(); ++f) {            bool success = wxRemoveFile(f->GetFullPath());            if (success) {                wxFileName deletedFile(f->GetFullPath());                filesDeleted.push_back(deletedFile);            } else {                wxFileName deletedFile(f->GetFullPath());                filesNotDeleted.push_back(deletedFile);            }            totalSuccess &= success;        }        t4p::ExplorerModifyEventClass modEvent(GetEventId(),                                               dirsDeleted, filesDeleted, dirsNotDeleted, filesNotDeleted, totalSuccess);        PostEvent(modEvent);    } else if (t4p::ExplorerModifyActionClass::RENAME_FILE == Action) {        wxFileName destFile(OldFile.GetPath(), NewName);        bool success = wxRenameFile(OldFile.GetFullPath(), destFile.GetFullPath(), false);        t4p::ExplorerModifyEventClass modEvent(GetEventId(),                                               OldFile, NewName, success);        PostEvent(modEvent);    }}
开发者ID:62BRAINS,项目名称:triumph4php,代码行数:47,


示例14: GetRedirectedName

bool CXmlFile::SaveXmlFile(){	bool exists = false;	bool isLink = false;	int flags = 0;	wxString redirectedName = GetRedirectedName();	if (CLocalFileSystem::GetFileInfo(redirectedName, isLink, 0, 0, &flags) == CLocalFileSystem::file) {#ifdef __WXMSW__		if (flags & FILE_ATTRIBUTE_HIDDEN)			SetFileAttributes(redirectedName, flags & ~FILE_ATTRIBUTE_HIDDEN);#endif		exists = true;		bool res;		{			wxLogNull null;			res = wxCopyFile(redirectedName, redirectedName + _T("~"));		}		if (!res) {			m_error = _("Failed to create backup copy of xml file");			return false;		}	}	bool success = false;	{		wxFFile f(redirectedName, _T("w"));		success = f.IsOpened() && m_pDocument->SaveFile(f.fp());	}	if (!success) {		wxRemoveFile(redirectedName);		if (exists) {			wxLogNull null;			wxRenameFile(redirectedName + _T("~"), redirectedName);		}		m_error = _("Failed to write xml file");		return false;	}	if (exists)		wxRemoveFile(redirectedName + _T("~"));	return true;}
开发者ID:Typz,项目名称:FileZilla,代码行数:47,


示例15: wxT

void wxGenericDirCtrl::OnEndEditItem(wxTreeEvent &event){    if (event.IsEditCancelled())        return;    if ((event.GetLabel().empty()) ||        (event.GetLabel() == wxT(".")) ||        (event.GetLabel() == wxT("..")) ||        (event.GetLabel().Find(wxT('/')) != wxNOT_FOUND) ||        (event.GetLabel().Find(wxT('//')) != wxNOT_FOUND) ||        (event.GetLabel().Find(wxT('|')) != wxNOT_FOUND))    {        wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR );        dialog.ShowModal();        event.Veto();        return;    }    wxTreeItemId treeid = event.GetItem();    wxDirItemData *data = (wxDirItemData*)m_treeCtrl->GetItemData( treeid );    wxASSERT( data );    wxString new_name( wxPathOnly( data->m_path ) );    new_name += wxString(wxFILE_SEP_PATH);    new_name += event.GetLabel();    wxLogNull log;    if (wxFileExists(new_name))    {        wxMessageDialog dialog(this, _("File name exists already."), _("Error"), wxOK | wxICON_ERROR );        dialog.ShowModal();        event.Veto();    }    if (wxRenameFile(data->m_path,new_name))    {        data->SetNewDirName( new_name );    }    else    {        wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR );        dialog.ShowModal();        event.Veto();    }}
开发者ID:drvo,项目名称:wxWidgets,代码行数:46,


示例16: SetPendingSave

void BaseCompressThread::ExecuteTaskInThread(){	// TODO : Add an API to PersistentThread for this! :)  --air	//SetThreadPriority( THREAD_PRIORITY_BELOW_NORMAL );	// Notes:	//  * Safeguard against corruption by writing to a temp file, and then copying the final	//    result over the original.	if( !m_src_list ) return;	SetPendingSave();		Yield( 3 );	uint listlen = m_src_list->GetLength();	for( uint i=0; i<listlen; ++i )	{		const ArchiveEntry& entry = (*m_src_list)[i];		if (!entry.GetDataSize()) continue;		wxArchiveOutputStream& woot = *(wxArchiveOutputStream*)m_gzfp->GetWxStreamBase();		woot.PutNextEntry( entry.GetFilename() );		static const uint BlockSize = 0x64000;		uint curidx = 0;		do {			uint thisBlockSize = std::min( BlockSize, entry.GetDataSize() - curidx );			m_gzfp->Write(m_src_list->GetPtr( entry.GetDataIndex() + curidx ), thisBlockSize);			curidx += thisBlockSize;			Yield( 2 );		} while( curidx < entry.GetDataSize() );				woot.CloseEntry();	}	m_gzfp->Close();	if( !wxRenameFile( m_gzfp->GetStreamName(), m_final_filename, true ) )		throw Exception::BadStream( m_final_filename )		.SetDiagMsg(L"Failed to move or copy the temporary archive to the destination filename.")		.SetUserMsg(_("The savestate was not properly saved. The temporary file was created successfully but could not be moved to its final resting place."));	Console.WriteLn( "(gzipThread) Data saved to disk without error." );}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:45,


示例17: wxT

void CSourcesListBox::EndEditLabel( wxListEvent& event ){#if wxVERSION_NUMBER >= 2500	if(event.IsEditCancelled())		return;#endif    wxString sCheck = event.GetText();	sCheck.Replace( wxT( " " ), wxT( "" ), TRUE );	if ( sCheck.IsEmpty() )		return; // do not want to rename to an empty string ( or one that only consists of spaces	EMUSIK_SOURCES_TYPE nType = GetType( event.GetIndex() );	wxString sType;	if(!GetTypeAsString(nType,sType))	{		wxASSERT(FALSE);		return;	}	//--- Musik Library entry edited ---//	if ( nType == MUSIK_SOURCES_LIBRARY )	{ 			}	//--- Now Playing entry edited ---//	else if ( nType == MUSIK_SOURCES_NOW_PLAYING )	{        	}	//--- "playlist with data in a file" renamed ---//	else	{		//--- rename file ---//		wxString sOldFile = OnGetItemText(event.GetIndex(),0);		wxString sNewFile = event.GetText();				SourcesToFilename( &sOldFile, nType );		SourcesToFilename( &sNewFile, nType );		wxRenameFile( sOldFile, sNewFile );	}	//--- rename in musiksources.dat ---//	m_SourcesList.Item( event.GetIndex() ) = sType + event.GetText();}
开发者ID:BackupTheBerlios,项目名称:musik-svn,代码行数:44,


示例18: GetRedirectedName

bool CXmlFile::SaveXmlFile(){	bool exists = false;	bool isLink = false;	int flags = 0;	wxString redirectedName = GetRedirectedName();	if (fz::local_filesys::get_file_info(fz::to_native(redirectedName), isLink, 0, 0, &flags) == fz::local_filesys::file) {#ifdef __WXMSW__		if (flags & FILE_ATTRIBUTE_HIDDEN)			SetFileAttributes(redirectedName.c_str(), flags & ~FILE_ATTRIBUTE_HIDDEN);#endif		exists = true;		bool res;		{			wxLogNull null;			res = wxCopyFile(redirectedName, redirectedName + _T("~"));		}		if (!res) {			m_error = _("Failed to create backup copy of xml file").ToStdWstring();			return false;		}	}	bool success = m_document.save_file(static_cast<wchar_t const*>(redirectedName.c_str()));	if (!success) {		wxRemoveFile(redirectedName);		if (exists) {			wxLogNull null;			wxRenameFile(redirectedName + _T("~"), redirectedName);		}		m_error = _("Failed to write xml file").ToStdWstring();		return false;	}	if (exists)		wxRemoveFile(redirectedName + _T("~"));	return true;}
开发者ID:zedfoxus,项目名称:filezilla-client,代码行数:43,


示例19: SaveXmlFile

bool SaveXmlFile(const wxFileName& file, TiXmlNode* node, wxString* error /*=0*/){	if (!node)		return true;	const wxString& fullPath = file.GetFullPath();	TiXmlDocument* pDocument = node->GetDocument();	bool exists = false;	if (wxFileExists(fullPath))	{		exists = true;		if (!wxCopyFile(fullPath, fullPath + _T("~")))		{			const wxString msg = _("Failed to create backup copy of xml file");			if (error)				*error = msg;			else				wxMessageBox(msg);			return false;		}	}	if (!pDocument->SaveFile(fullPath.mb_str()))	{		wxRemoveFile(fullPath);		if (exists)			wxRenameFile(fullPath + _T("~"), fullPath);		const wxString msg = _("Failed to write xml file");		if (error)			*error = msg;		else			wxMessageBox(msg);		return false;	}	if (exists)		wxRemoveFile(fullPath + _T("~"));	return true;}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:42,


示例20: wxRenameFile

bool DirManager::MoveToNewProjectDirectory(BlockFile *f){   wxString newFullPath = projFull + pathChar + f->mName;   if (newFullPath != f->mFullPath) {      bool ok = wxRenameFile(f->mFullPath, newFullPath);      if (ok)         f->mFullPath = newFullPath;      else {         ok = wxCopyFile(f->mFullPath, newFullPath);         if (ok) {            wxRemoveFile(f->mFullPath);            f->mFullPath = newFullPath;         }         else            return false;      }   }   return true;}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:20,


示例21: wxT

voidmmg_app::prepare_mmg_data_folder() {  // The 'jobs' folder is part of the application data  // folder. Therefore both directories will be creatd.  // 'prepare_path' treats the last part of the path as a file name;  // therefore append a dummy file name so that all directory parts  // will be created.  mm_file_io_c::prepare_path(wxMB(get_jobs_folder() + wxT("/dummy")));#if !defined(SYS_WINDOWS)  // Migrate the config file from its old location ~/.mkvmergeGUI to  // the new location ~/.mkvtoolnix/config  wxString old_config_name;  wxGetEnv(wxT("HOME"), &old_config_name);  old_config_name += wxT("/.mkvmergeGUI");  if (wxFileExists(old_config_name))    wxRenameFile(old_config_name, get_config_file_name());#endif}
开发者ID:VRDate,项目名称:mkvtoolnix,代码行数:20,


示例22: Delete

//---------------------------------------------------------------------------bool File::Move(const Ztring &Source, const Ztring &Destination, bool OverWrite){    if (OverWrite && Exists(Source))        Delete(Destination);    #ifdef ZENLIB_USEWX        if (OverWrite && Exists(Destination))            wxRemoveFile(Destination.c_str());        return wxRenameFile(Source.c_str(), Destination.c_str());    #else //ZENLIB_USEWX        #ifdef ZENLIB_STANDARD            return !std::rename(Source.To_Local().c_str(), Destination.To_Local().c_str());        #elif defined WINDOWS            #ifdef UNICODE                return MoveFileW(Source.c_str(), Destination.c_str())!=0;            #else                return MoveFile(Source.c_str(), Destination.c_str())!=0;            #endif //UNICODE        #endif    #endif //ZENLIB_USEWX}
开发者ID:Armada651,项目名称:mpc-hc,代码行数:21,


示例23: wxRenameFile

void DirManager::MakePartOfProject(BlockFile *f){  wxString newFullPath = projFull + pathChar + f->name;  if (newFullPath != f->fullPath) {    bool ok = wxRenameFile(f->fullPath, newFullPath);    if (ok)      f->fullPath = newFullPath;    else {      ok = wxCopyFile(f->fullPath, newFullPath);      if (ok) {	wxRemoveFile(f->fullPath);	f->fullPath = newFullPath;      } else {	wxString msg;	msg.Printf("Could not rename %s to %s",		   (const char *)f->fullPath, (const char *)newFullPath);	wxMessageBox(msg);      }    }  }}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:21,


示例24: newFileName

bool DirManager::MoveToNewProjectDirectory(BlockFile *f){   wxFileName newFileName(projFull, f->mFileName.GetFullName());   if ( !(newFileName == f->mFileName) ) {      bool ok = wxRenameFile(f->mFileName.GetFullPath(), newFileName.GetFullPath());      if (ok)         f->mFileName = newFileName;      else {         ok = wxCopyFile(f->mFileName.GetFullPath(), newFileName.GetFullPath());         if (ok) {            wxRemoveFile(f->mFileName.GetFullPath());            f->mFileName = newFileName;         }         else            return false;      }   }   return true;}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:22,


示例25: wxFileNameFromPath

bool mmAttachmentManage::DeleteAttachment(const wxString& FileToDelete){    if (wxFileExists(FileToDelete))    {        if (Model_Infotable::instance().GetBoolInfo("ATTACHMENTSTRASH", false))        {            wxString DeletedAttachmentFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting()) + m_PathSep + "Deleted";            if (!wxDirExists(DeletedAttachmentFolder))            {                if (wxMkdir(DeletedAttachmentFolder))                    mmAttachmentManage::CreateReadmeFile(DeletedAttachmentFolder);                else                    return false;            }            wxString FileToTrash = DeletedAttachmentFolder + m_PathSep                + wxDateTime::Now().FormatISODate() + "_" + wxFileNameFromPath(FileToDelete);            if (!wxRenameFile(FileToDelete, FileToTrash))                return false;        }        else if (!wxRemoveFile(FileToDelete))            return false;    }    else    {        wxString msgStr = wxString() << _("Attachment not found:") << "/n"            << "'" << FileToDelete << "'" << "/n"            << "/n"            << _("Do you want to continue and delete attachment on database?") << "/n";        int DeleteResponse = wxMessageBox(msgStr, _("Delete attachment failed"), wxYES_NO | wxNO_DEFAULT | wxICON_ERROR);        if (DeleteResponse == wxYES)            return true;        else            return false;    }    return true;}
开发者ID:moneymanagerex,项目名称:moneymanagerex,代码行数:39,


示例26: wxFileExists

//----------------------------------------bool wxBratTools::RenameFile(const wxString& oldName, const wxString& newName){  bool bOk = true;  bOk = wxFileExists(oldName);  if (bOk == false)  {    return true;  }  try  {    bOk = wxRenameFile(oldName, newName);  }  catch (...)  {    //Nothing to do    bOk = false;  }  return bOk;}
开发者ID:adakite,项目名称:main,代码行数:23,


示例27: wxGetUserId

bool CodeLiteApp::IsSingleInstance(const wxCmdLineParser &parser, const wxString &curdir){    // check for single instance    if ( clConfig::Get().Read("SingleInstance", false) ) {        const wxString name = wxString::Format(wxT("CodeLite-%s"), wxGetUserId().c_str());        m_singleInstance = new wxSingleInstanceChecker(name);        if (m_singleInstance->IsAnotherRunning()) {            // prepare commands file for the running instance            wxString files;            for (size_t i=0; i< parser.GetParamCount(); i++) {                wxString argument = parser.GetParam(i);                //convert to full path and open it                wxFileName fn(argument);                fn.MakeAbsolute(curdir);                files << fn.GetFullPath() << wxT("/n");            }            if (files.IsEmpty() == false) {                Mkdir(ManagerST::Get()->GetStarupDirectory() + wxT("/ipc"));                wxString file_name, tmp_file;                tmp_file 	<< ManagerST::Get()->GetStarupDirectory()                            << wxT("/ipc/command.msg.tmp");                file_name 	<< ManagerST::Get()->GetStarupDirectory()                            << wxT("/ipc/command.msg");                // write the content to a temporary file, once completed,                // rename the file to the actual file name                WriteFileUTF8(tmp_file, files);                wxRenameFile(tmp_file, file_name);            }            return false;        }    }    return true;}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:39,


示例28: installDlg

void ModEditWindow::OnInstallForgeClicked(wxCommandEvent &event){	InstallForgeDialog installDlg (this, m_inst->GetMCVersion());	installDlg.CenterOnParent();	if (installDlg.ShowModal() == wxID_OK)	{		auto ver = installDlg.GetSelectedItem();		wxString forgePath = Path::Combine(m_inst->GetInstModsDir(), ver.Filename);				auto dlTask = new FileDownloadTask(ver.Url, wxFileName("forge.zip"));		TaskProgressDialog taskDlg(this);		taskDlg.CenterOnParent();		if (taskDlg.ShowModal(dlTask))		{			MinecraftForge forge(wxFileName("forge.zip"));			forge.FixVersionIfNeeded(ver.ForgeVersion);			wxRenameFile("forge.zip",forgePath, true);			m_inst->GetModList()->InsertMod(0, forgePath);			jarModList->UpdateItems();		}	}}
开发者ID:Kuchikixx,项目名称:MultiMC4,代码行数:22,


示例29: fnOld

bool PHPFolder::RenameFile(const wxString& old_filename, const wxString& new_filename){    wxFileName fnOld(old_filename);    wxFileName fnNew(new_filename);    fnNew.SetPath(fnOld.GetPath());    int where = m_files.Index(fnOld.GetFullName());    if(where == wxNOT_FOUND) {        return false;    }    // a file with this name already exists    if(fnNew.Exists()) {        return false;    }    m_files.RemoveAt(where);    m_files.Add(fnNew.GetFullName());    m_files.Sort();    // Step: 2    // Notify the plugins, maybe they want to override the    // default behavior (e.g. Subversion plugin)    wxArrayString f;    f.Add(fnOld.GetFullPath());    f.Add(fnNew.GetFullPath());    if(!::SendCmdEvent(wxEVT_FILE_RENAMED, (void*)&f)) {        // rename the file on filesystem        wxRenameFile(fnOld.GetFullPath(), fnNew.GetFullPath());    }    PHPEvent eventFileRenamed(wxEVT_PHP_FILE_RENAMED);    eventFileRenamed.SetOldFilename(fnOld.GetFullPath());    eventFileRenamed.SetFileName(fnNew.GetFullPath());    EventNotifier::Get()->AddPendingEvent(eventFileRenamed);    return true;}
开发者ID:05storm26,项目名称:codelite,代码行数:38,



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


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