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

C++ GetFolder函数代码示例

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

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



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

示例1: OnAddNew

void CWSFCHomeListCtrl::OnAddNew (void)
{
    // Get WSF/C Home Path
    CString sPath;
    if (FALSE == GetFolder (&sPath, "Find WSF/C Home Location.", this->m_hWnd, NULL, NULL))
        return;

    // Validate Path
    if (true == sPath.IsEmpty ())
        return;

    CString sAxis2XMLFile = sPath;
    if (sAxis2XMLFile[sAxis2XMLFile.GetLength () - 1] != '\\')
        sAxis2XMLFile+= "\\";
    sAxis2XMLFile+= "axis2.xml";

    CFile oAxis2XMLFile;
    if (FALSE == oAxis2XMLFile.Open (sAxis2XMLFile, CFile::modeRead | CFile::shareDenyNone))
    {
        CString sMessage = "\"";
        sMessage+= sPath;
        sMessage+= "\" is not a valid WSF/C home !!!";
        AfxMessageBox (sMessage, MB_ICONEXCLAMATION | MB_OK);

        return;
    }

    // Add Path to List Ctrl
    InsertItem (GetItemCount (), sPath);
}
开发者ID:harunjuhasz,项目名称:wsf,代码行数:30,代码来源:WSFCHomeListCtrl.cpp


示例2: GetEditControl

void CFileBrowserListCtrl::OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult) 
{
	LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
	CEdit	*pEdit = GetEditControl();
	if (m_LabelEdit && pEdit != NULL) {	// if label edit wasn't canceled
		CString	NewName;
		pEdit->GetWindowText(NewName);	// label is new item name
		int	ItemIdx = pDispInfo->item.iItem;
		CDirItem&	item = m_DirList.GetItem(ItemIdx);
		if (NewName != item.GetName()) {	// if name is different
			CPathStr	NewPath(GetFolder());
			NewPath.Append(NewName);	// make new item path
			CString	OldPath(GetItemPath(ItemIdx));
			if (RenameFile(m_hWnd, OldPath, NewPath)) {
				item.SetName(NewName);	// update item name
				NMFBRENAMEITEM	nmri;
				nmri.pszOldPath = OldPath;
				nmri.pszNewPath = NewPath;
				Notify(FBLCN_RENAMEITEM, &nmri);
			}
		}
	}
	m_LabelEdit = FALSE;
	*pResult = 0;
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:25,代码来源:FileBrowserListCtrl.cpp


示例3: FindAnimeItem

void FolderMonitor::OnFile(const DirectoryChangeNotification& notification) const {
  anime::Episode episode;
  auto anime_item = FindAnimeItem(notification, episode);

  if (!anime_item)
    return;
  if (!Meow.IsValidAnimeType(episode) || !Meow.IsValidFileExtension(episode))
    return;

  bool path_available = notification.action != FILE_ACTION_REMOVED;

  // Set anime folder
  if (path_available && anime_item->GetFolder().empty()) {
    ChangeAnimeFolder(*anime_item, episode.folder);
  }

  // Set episode availability
  int lower_bound = anime::GetEpisodeLow(episode);
  int upper_bound = anime::GetEpisodeHigh(episode);
  std::wstring path = notification.path + notification.filename.first;
  for (int number = lower_bound; number <= upper_bound; ++number) {
    if (anime_item->SetEpisodeAvailability(number, path_available, path)) {
      LOG(LevelDebug, anime_item->GetTitle() + L" #" + ToWstr(number) + L" is " +
          (path_available ? L"available." : L"unavailable."));
    }
  }
}
开发者ID:Hydro8182,项目名称:taiga,代码行数:27,代码来源:monitor.cpp


示例4: GetFolder

int CmFile::GetNames(CStr &nameW, vecS &names)
{
	string dir = GetFolder(nameW);
	names.clear();
	names.reserve(6000);

	DIR *dp = opendir(_S(dir));
	if (dp == NULL){
		cout << dir << endl;
		perror("Cannot open directory");
		return EXIT_FAILURE;
	}

	struct dirent *dirContent;
	while ((dirContent = readdir(dp)) != NULL){		
		if (string(dirContent->d_name)[0] == '.')
			continue;
		struct stat st;
		lstat(dirContent->d_name,&st);
		
		if(S_ISREG(st.st_mode)){
			cout << string(dirContent->d_name) << " " << st.st_mode << endl;
			names.push_back(string(dirContent->d_name));
		}

	}

	closedir(dp);
	return (int)names.size();
}
开发者ID:Belial2010,项目名称:BING-Objectness,代码行数:30,代码来源:CmFile.cpp


示例5: GetFolder

void COutlook2Ctrl::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
{
	if (m_iSelectedFolder < 0) return;

	COL2Folder * oFolder = GetFolder(m_iSelectedFolder);
	for (int i = 0; i < oFolder->m_Items.GetSize(); i++)
	{
		COL2Item * pi = (COL2Item *) oFolder->m_Items.GetAt(i);
		for (int s = 0; s < pi->m_SubItems.GetSize(); s++)
		{
			COL2SubItem * ps = (COL2SubItem *) pi->m_SubItems.GetAt(s);
			if (ps->dwStyle == OCL_SELECT || ps->dwStyle == OCL_RADIO || ps->dwStyle == OCL_CHECK)
			{
				COL2CCmdUI pui;
				pui.pSI = ps;
				pui.m_nID = ps->lParam; 
				GetOwner()->OnCmdMsg(pui.m_nID, CN_UPDATE_COMMAND_UI, &pui, NULL);
				if (pui.iRes != ps->iLastStatus && !ps->rcItem.IsRectEmpty())
				{
                    InvalidateRect(ps->rcItem);					
				}
			}
		}
	}

/*	iLastStatus = pui.iRes;

	TRACE1("%d\n", (int) GetTickCount());
	CToolBar b;
	b.OnUpdateCmdUI(*/
}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:31,代码来源:Outlook2Ctrl.cpp


示例6: path

void CFileBrowserListCtrl::OpenParentFolder()
{
	CPathStr	path(GetFolder());
	if (PathIsRoot(path))
		path.Empty();	// show drive list
	else
		path.Append(_T(".."));
	SetFolder(path);
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:9,代码来源:FileBrowserListCtrl.cpp


示例7: OnMenu_Extract

/**
 * "파일 풀기"를 눌렀을때 파일을 하나 푸는 함수
 */
void CFV_Select::OnMenu_Extract ()
{
	int * pIndecies			= NULL;	/// 선택된 인덱스를 저장
	CListBox * plistSel		= NULL; /// 리스트 박스용
	int nSelCnt				= 0;	/// 선택된 갯수
	BYTE * btBuff			= NULL;	/// 임시버퍼
	CVFS_Manager * pVFS		= NULL;	/// vfs파일 핸들
	FILE * fp				= NULL;	/// 임시 파일포인터
	VFileHandle *pVFH		= NULL; /// vfs 파일핸들
	CString strText = "", strFileName = "", strDir = ""; /// 스트링, 파일이름, 폴더


	if(m_list.GetSelCount () > 0 && (plistSel = GetListBox ()) && (pVFS = ::g_pDlg_Main->GetVFS()) 
		&&::g_pDlg_Main->GetSelectedVfsName ().GetLength () > 0)
	{
		/// 파일을 풀 디렉토리를 묻는다
		if(GetFolder (&strDir, "파일을 풀 폴더를 선택하세요", GetSafeHwnd (), NULL, NULL))
		{
			/// 인덱스를 저장하기 위해서 메모리를 할당
			if((pIndecies = new int[m_list.GetSelCount ()]))
			{
				/// 선택된 인덱스들을 가져옴
				m_list.GetSelItems (m_list.GetSelCount (), pIndecies);
				nSelCnt = m_list.GetSelCount ();
				for(short i = 0; i < nSelCnt; i++)
				{
					strText = "";
					/// 리스트박스에서 문자열을 가져옴
					plistSel->GetText (pIndecies[ nSelCnt - 1 - i ], strText);
					/// base file명만 불리해서 여기에 다시 저장하고 그리고 파일 생성할 때 사용한다
					strFileName = strText;
					if(strFileName.ReverseFind ('\\') >= 0)
					{ 
						strFileName = strFileName.Right (strFileName.GetLength () - strFileName.ReverseFind ('\\') - 1); 
					}
					long lFileLength = pVFS->GetFileLength (strText.GetString ());
					if(lFileLength >= 0 && (btBuff = new BYTE[ lFileLength ]))
					{
						if((pVFH = pVFS->OpenFile (strText.GetString ())))
						{
							vfread (btBuff, sizeof (BYTE), (size_t)lFileLength, pVFH);
							_fmode = _O_BINARY;
							if((fp = fopen (strDir + "\\" + strFileName, "w")))
							{
								fwrite (btBuff, sizeof(BYTE), (size_t)lFileLength, fp);
								fclose (fp);
							}
							delete btBuff;
							pVFS->CloseFile (pVFH);
						}
					}
				}
				delete pIndecies;
			}
		}
	}
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:60,代码来源:FV_Select.cpp


示例8: GetFolder

NS_IMETHODIMP nsNntpUrl::GetFolderCharsetOverride(bool *aCharacterSetOverride) {
  nsCOMPtr<nsIMsgFolder> folder;
  nsresult rv = GetFolder(getter_AddRefs(folder));
  NS_ENSURE_SUCCESS(rv, rv);
  NS_ENSURE_TRUE(folder, NS_ERROR_FAILURE);
  rv = folder->GetCharsetOverride(aCharacterSetOverride);
  NS_ENSURE_SUCCESS(rv, rv);
  return rv;
}
开发者ID:mozilla,项目名称:releases-comm-central,代码行数:9,代码来源:nsNntpUrl.cpp


示例9: GetFolder

PyObject* pyVault::GetAgeJournalsFolder()
{
    PyObject * result = GetFolder(plVault::kAgeJournalsFolder);
    
    // just return an empty node
    if (!result)
        result = pyVaultFolderNode::New(nil);
        
    return result;
}
开发者ID:Asteral,项目名称:Plasma,代码行数:10,代码来源:pyVault.cpp


示例10: GetFolder

PyObject* pyVault::GetInbox( void )
{
    PyObject * result = GetFolder(plVault::kInboxFolder);

    // if good then return py object
    if (result)
        return result;

    // otherwise return a None object
    PYTHON_RETURN_NONE;
}
开发者ID:branan,项目名称:Plasma,代码行数:11,代码来源:pyVault.cpp


示例11: dc

int CFileBrowserListCtrl::CalcMinColumnWidth(int Col)
{
	enum {
		BORDER = 6,	// minimal spacing; less causes abbreviated text
		SLACK = 3	// prevents widest item from touching right edge
	};
	CWaitCursor	wc;	// iterating all items can be slow, especially for file type
	CClientDC	dc(this);
	HGDIOBJ	PrevFont = dc.SelectObject(GetFont());	// must use list control's font
	int	width = 0;
	CSize	sz;
	CFileInfo	FileInfo;
	CString	str;
	int	items = m_DirList.GetCount();
	for (int i = 0; i < items; i++) {
		const CDirItem&	item = m_DirList.GetItem(i);
		switch (Col) {
		case COL_NAME:
			str = item.GetName();
			break;
		case COL_SIZE:
			if (item.IsDir())
				continue;
			FormatSize(item.GetLength(), str);
			break;
		case COL_TYPE:	// slow if we have many unique file types that aren't cached
			m_FileInfoCache.GetFileInfo(GetFolder(), item, FileInfo);
			str = FileInfo.GetTypeName();
			break;
		case COL_MODIFIED:
			if (item.GetLastWrite() == 0)
				continue;
			FormatTime(item.GetLastWrite(), str);
			break;
		default:
			ASSERT(0);
		}
		GetTextExtentPoint32(dc.m_hDC, str, str.GetLength(), &sz);
		if (sz.cx > width)
			width = sz.cx;
	}
	dc.SelectObject(PrevFont);	// restore DC's previous font
	// 25feb09: GetItemRect can fail e.g. if list is empty, in which case we
	// must avoid adding garbage to column width
	CRect	IconRect;
	if (GetItemRect(0, IconRect, LVIR_ICON))
		width += IconRect.Width();
	else	// can't get item rect, fall back to system metrics
		width += GetSystemMetrics(m_ViewType == VTP_ICON ? SM_CXICON : SM_CXSMICON);
	width += BORDER + SLACK;
	return(width);
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:52,代码来源:FileBrowserListCtrl.cpp


示例12: GetFolder

int CUpdateUtil::GetFolderSymbol(CString& strPath, CString& strReplace)
{
	int retval = 0;
	CString strCompare = strPath;
	CString strCompareOriginal = strPath;
	CString strCompareReplace = "";

	if(*m_pbCancel)
	{		
		retval = UPDATE_ERROR;
		return retval;
	}

	int nStart = strCompare.Find('%');
	if(nStart != -1 && nStart == 0)
	{
		int nEnd = strCompare.Find('%', nStart+1);
		if(nEnd != -1)
		{
			strReplace = strCompare.Left(nEnd+1);
			strCompare = strCompare.Left(nEnd);
			strCompareReplace = strCompare.Right(strCompare.GetLength()-1);
			retval = GetFolder(strCompareReplace);
		}
		else
			retval = UPDATE_ERROR;
	}
	else
	{
		int nFindColon = strCompare.Find(':');
		if(nFindColon !=-1 && nFindColon == 1)
		{
			retval = UPDATE_ERROR;
		}
		else
		{
			strReplace = "%CurrentDirectory%";
			int nFind = strCompare.Find('\\');
			if(nFind != -1 && nFind == 0)
			{
				strPath = strReplace + strCompareOriginal;
			}
			else
			{
				strPath = strReplace + "\\" + strCompareOriginal;		
			}
			retval = UPDATE_CURRENTDIRECTORY;
		}
	}
	
	return retval;
}
开发者ID:jongha,项目名称:update-dll,代码行数:52,代码来源:UpdateUtil.cpp


示例13: HeaderFolder2

void CRecBinViewer::InitInterfaces (void)
{
	if (TRUE == GetFolder2 ())	
		HeaderFolder2 ();	
	else 
		if (TRUE == GetFolder ())			
				HeaderFolder ();
			
	if (gFolderStateMan.IsIn (CONST_RECYCLEBIN))
		gFolderStateMan.LoadState (CONST_RECYCLEBIN, m_State);
	else
		gFolderStateMan.SaveState (CONST_RECYCLEBIN, m_State);		
}
开发者ID:avrionov,项目名称:explorerxp,代码行数:13,代码来源:RecBinViewer.cpp


示例14: SetTo

void
DPath::SetBaseName(const char *string)
{
	if (IsEmpty())
	{
		SetTo(string);
		return;
	}
	
	BString temp = GetFolder();
	BString ext = GetExtension();
	temp << "/" << string << "." << ext;
}
开发者ID:HaikuArchives,项目名称:Paladin,代码行数:13,代码来源:DPath.cpp


示例15: BuildExtList

W64INT CSaveAsDlg::DoModal()
{
	BuildExtList();
	if (m_psFolder != NULL) {
		m_ofn.lpstrInitialDir = *m_psFolder;
		m_ofn.Flags |= OFN_NOCHANGEDIR;	// otherwise folder stays locked
	}
	W64INT	retc = CFileDialog::DoModal();
	if (retc == IDOK) {
		if (m_psFolder != NULL)
			GetFolder(*m_psFolder);
	}
	return(retc);
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:14,代码来源:SaveAsDlg.cpp


示例16: NS_ENSURE_ARG_POINTER

NS_IMETHODIMP nsMailboxUrl::GetFolderCharset(char ** aCharacterSet)
{
  NS_ENSURE_ARG_POINTER(aCharacterSet);
  nsCOMPtr<nsIMsgFolder> folder;
  nsresult rv = GetFolder(getter_AddRefs(folder));
  
  // In cases where a file is not associated with a folder, for
  // example standalone .eml files, failure is normal.
  if (NS_FAILED(rv))
    return rv;
  nsCString tmpStr;
  folder->GetCharset(tmpStr);
  *aCharacterSet = ToNewCString(tmpStr);
  return NS_OK;
}
开发者ID:MoonchildProductions,项目名称:FossaMail,代码行数:15,代码来源:nsMailboxUrl.cpp


示例17: folder

void ecChooseRepositoryDialog::OnOK(wxCommandEvent& event)
{
    wxString folder(GetFolder());
    if (!wxDirExists(folder))
    {
        wxMessageBox(_("This is not a valid folder."));
        return; // Don't Skip so we don't dismiss the dialog
    }
    if (FALSE)
    {
        wxMessageBox(_("This does not like a valid eCos repository."));
        return; // Don't Skip so we don't dismiss the dialog
    }
    event.Skip();
}
开发者ID:perryhg,项目名称:terkos,代码行数:15,代码来源:choosereposdlg.cpp


示例18: GetFolder

void InfoBox::GetFolder(BDirectory dir) {

	int32 c=dir.CountEntries();
	BEntry entry;
	
	if (c>0)
	for (int32 i=0; i<c; i++) {
		dir.GetNextEntry(&entry, true);
		if (entry.IsDirectory()) {
			folders++;
			GetFolder(BDirectory(&entry));
		}
		else
			files++;
	}
}
开发者ID:carriercomm,项目名称:Helios,代码行数:16,代码来源:InfoBox.cpp


示例19: OnBrowseInclude

void CDirectoriesPropertyPage::OnBrowseInclude() 
{
	CString strFolderPath;
	if (GetFolder(&strFolderPath, _T("Browse for folder to include in search") , this->m_hWnd, NULL, NULL) && !strFolderPath.IsEmpty() )
	{
	//	CString Temp;
//	 m_IncludeDirs.GetWindowText(Temp);
//  if (!Temp.IsEmpty()) Temp += "\r\n";
//		Temp += strFolderPath;
//	 m_IncludeDirs.SetWindowText(Temp);


m_IncludeDirectoriesList.AddString(strFolderPath);
		//m_IncDirsList.InsertItem(0,Temp);
	}
}
开发者ID:GerHobbelt,项目名称:duff,代码行数:16,代码来源:PropertyPageDirectories.cpp


示例20: GetItemPath

void CFileBrowserListCtrl::OpenItem(int ItemIdx)
{
	// copy item instead of referencing it, because SetFolder changes m_DirList
	CDirItem	Item = m_DirList.GetItem(ItemIdx);
	CString	ItemPath = GetItemPath(ItemIdx);	// grab item path now too
	if (Item.IsDir()) {
		// if user selected parent folder and current folder is a root folder
		if (Item.IsDots() && PathIsRoot(GetFolder()))
			SetFolder(_T(""));	// list drives
		else
			SetFolder(ItemPath);
	}
	NMFBOPENITEM	nmoi;
	nmoi.pszPath = ItemPath;
	nmoi.bIsDir = Item.IsDir();
	Notify(FBLCN_OPENITEM, &nmoi);
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:17,代码来源:FileBrowserListCtrl.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetFontHeight函数代码示例发布时间:2022-05-30
下一篇:
C++ GetFocusWidget函数代码示例发布时间: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