当前位置: 首页>>代码示例>>C++>>正文


C++ STRING_VECTOR::at方法代码示例

本文整理汇总了C++中STRING_VECTOR::at方法的典型用法代码示例。如果您正苦于以下问题:C++ STRING_VECTOR::at方法的具体用法?C++ STRING_VECTOR::at怎么用?C++ STRING_VECTOR::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在STRING_VECTOR的用法示例。


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

示例1: SubmoduleCallback

static int SubmoduleCallback(git_submodule *sm, const char * /*name*/, void *payload)
{
	STRING_VECTOR *list = *(STRING_VECTOR **)payload;
	STRING_VECTOR *prefixList = *((STRING_VECTOR **)payload + 1);
	CString path = CUnicodeUtils::GetUnicode(git_submodule_path(sm));
	if (prefixList->empty())
		list->push_back(path);
	else
	{
		for (size_t i = 0; i < prefixList->size(); ++i)
		{
			CString prefix = prefixList->at(i) + L'/';
			if (CStringUtils::StartsWith(path, prefix))
				list->push_back(path);
		}
	}
	return 0;
}
开发者ID:YueLinHo,项目名称:TortoiseGit,代码行数:18,代码来源:SubmoduleUpdateDlg.cpp

示例2: SubmoduleCallback

static int SubmoduleCallback(git_submodule *sm, const char * /*name*/, void *payload)
{
	STRING_VECTOR *list = *(STRING_VECTOR **)payload;
	STRING_VECTOR *prefixList = *((STRING_VECTOR **)payload + 1);
	CString path = CUnicodeUtils::GetUnicode(git_submodule_path(sm));
	if (prefixList->empty())
	{
		list->push_back(path);
	}
	else
	{
		for (size_t i = 0; i < prefixList->size(); ++i)
		{
			CString prefix = prefixList->at(i) + _T("/");
			if (path.Left(prefix.GetLength()) == prefix)
				list->push_back(path);
		}
	}
	return 0;
}
开发者ID:mhoque01,项目名称:TortoiseGit,代码行数:20,代码来源:SubmoduleUpdateDlg.cpp

示例3: OnInitDialog

BOOL CFirstStartWizardAuthentication::OnInitDialog()
{
	CFirstStartWizardBasePage::OnInitDialog();

	CString tmp;
	tmp.LoadString(IDS_FIRSTSTART_SSHHINT);
	GetDlgItem(IDC_FIRSTSTART_SSHHINT)->SetWindowText(tmp);

	CAutoConfig config(true);
	if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitGlobalConfig()), GIT_CONFIG_LEVEL_GLOBAL, nullptr, FALSE))
		MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION);
	else
	{
		if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitGlobalXDGConfig()), GIT_CONFIG_LEVEL_XDG, nullptr, FALSE))
			MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION);
	}
	if (!g_Git.ms_bCygwinGit && !g_Git.ms_bMsys2Git)
	{
		if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitProgramDataConfig()), GIT_CONFIG_LEVEL_PROGRAMDATA, nullptr, FALSE))
			MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION);
	}
	if (git_config_add_file_ondisk(config, CGit::GetGitPathStringA(g_Git.GetGitSystemConfig()), GIT_CONFIG_LEVEL_SYSTEM, nullptr, FALSE))
		MessageBox(g_Git.GetLibGit2LastErr(), L"TortoiseGit", MB_ICONEXCLAMATION);

	STRING_VECTOR defaultList;
	git_config_foreach_match(config, "credential\\.helper", CSettingGitCredential::GetCredentialDefaultUrlCallback, &defaultList);

	if (defaultList.size() <= 1 && (defaultList.empty() || defaultList.at(0)[0] == 'X' || defaultList.at(0)[0] == 'G'))
		AddHelper(m_ctrlSimpleCredential, m_availableHelpers, MAKEINTRESOURCE(IDS_NONE));
	CString selectedHelper;
	if (config.GetString(L"credential.helper", selectedHelper) == GIT_ENOTFOUND)
		m_ctrlSimpleCredential.SetCurSel(0);

	if (CSettingGitCredential::GCMExists())
		AddHelper(m_ctrlSimpleCredential, m_availableHelpers, L"manager", selectedHelper);
	if (CSettingGitCredential::WincredExists())
		AddHelper(m_ctrlSimpleCredential, m_availableHelpers, L"wincred", selectedHelper);
	if (CSettingGitCredential::WinstoreExists())
		AddHelper(m_ctrlSimpleCredential, m_availableHelpers, CSettingGitCredential::GetWinstorePath(), selectedHelper);

	STRING_VECTOR urlList;
	git_config_foreach_match(config, "credential\\..*\\.helper", CSettingGitCredential::GetCredentialUrlCallback, &urlList);
	if (!urlList.empty() || m_ctrlSimpleCredential.GetCurSel() == -1)
	{
		m_ctrlSimpleCredential.EnableWindow(FALSE);
		m_availableHelpers.clear();
		m_ctrlSimpleCredential.Clear();
		AddHelper(m_ctrlSimpleCredential, m_availableHelpers, MAKEINTRESOURCE(IDS_ADVANCED));
		m_ctrlSimpleCredential.SetCurSel(0);
	}

	AdjustControlSize(IDC_DONTSAVE);

	CString sshclient = CRegString(L"Software\\TortoiseGit\\SSH");
	if (sshclient.IsEmpty())
		sshclient = CRegString(L"Software\\TortoiseGit\\SSH", L"", FALSE, HKEY_LOCAL_MACHINE);

	int idx = m_ctrlSSHClient.AddString(L"TortoiseGitPlink");
	if (sshclient.IsEmpty() || IsTool(L"tortoisegitplink", sshclient) || IsTool(L"tortoiseplink", sshclient))
		m_ctrlSSHClient.SetCurSel(idx);
	idx = m_ctrlSSHClient.AddString(L"OpenSSH");
	if (IsTool(L"ssh", sshclient))
		m_ctrlSSHClient.SetCurSel(idx);
	if (m_ctrlSSHClient.GetCurSel() == -1)
	{
		idx = m_ctrlSSHClient.AddString(sshclient);
		m_ctrlSSHClient.SetCurSel(idx);
	}

	// TODO: Hide the button if PuTTY is not used?
	//GetDlgItem(IDC_GENERATEPUTTYKEY)->ShowWindow(CAppUtils::IsSSHPutty() ? SW_SHOW : SW_HIDE);

	UpdateData(FALSE);

	return TRUE;
}
开发者ID:YueLinHo,项目名称:TortoiseGit,代码行数:76,代码来源:FirstStartWizardAuthentication.cpp


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