本文整理汇总了C++中STRING_VECTOR::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ STRING_VECTOR::erase方法的具体用法?C++ STRING_VECTOR::erase怎么用?C++ STRING_VECTOR::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STRING_VECTOR
的用法示例。
在下文中一共展示了STRING_VECTOR::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Refresh
void CPushDlg::Refresh()
{
CString WorkingDir=g_Git.m_CurrentDir;
WorkingDir.Replace(_T(':'),_T('_'));
CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));
m_RemoteReg = remote;
int sel = -1;
STRING_VECTOR list;
m_Remote.Reset();
list.push_back(CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)));
if(!g_Git.GetRemoteList(list))
{
if (list.size() <= 2)
list.erase(list.begin());
for (unsigned int i = 0; i < list.size(); ++i)
{
m_Remote.AddString(list[i]);
if(list[i] == remote)
sel = i;
}
}
// if the last selected remote was "- All -" and "- All -" is still in the list -> select it
if (list.size() > 1 && remote == CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)))
sel = 0;
m_Remote.SetCurSel(sel);
int current=0;
list.clear();
m_BranchSource.Reset();
m_BranchSource.AddString(_T(" ")); // empty string does not work, for removal of remote branches/tags
m_BranchSource.SetMaxHistoryItems(0x7FFFFFFF);
if(!g_Git.GetBranchList(list,¤t))
{
for (unsigned int i = 0; i < list.size(); ++i)
m_BranchSource.AddString(list[i]);
++current; // shift for " "
}
if (wcsncmp(m_BranchSourceName, _T("refs/"), 5) == 0)
m_BranchSourceName = m_BranchSourceName.Mid(5);
if (wcsncmp(m_BranchSourceName, _T("heads/"), 6) == 0)
{
m_BranchSourceName = m_BranchSourceName.Mid(6);
m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
}
else if (wcsncmp(m_BranchSourceName, _T("remotes/"), 8) == 0)
m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
else
m_BranchSource.SetCurSel(current);
GetRemoteBranch(m_BranchSource.GetString());
this->GetDlgItem(IDOK)->EnableWindow(m_BranchSource.GetCount() != 0);
}
示例2: Refresh
void CPullFetchDlg::Refresh()
{
//Select pull-remote from current branch
CString currentBranch = g_Git.GetSymbolicRef();
CString configName;
configName.Format(L"branch.%s.remote", currentBranch);
CString pullRemote = this->m_configPullRemote = g_Git.GetConfigValue(configName);
//Select pull-branch from current branch
configName.Format(L"branch.%s.merge", currentBranch);
CString pullBranch = m_configPullBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
if (pullBranch.IsEmpty())
m_RemoteBranch.AddString(currentBranch);
else
m_RemoteBranch.AddString(pullBranch);
if(pullRemote.IsEmpty())
pullRemote = m_RemoteReg;
if (!m_PreSelectRemote.IsEmpty())
pullRemote = m_PreSelectRemote;
STRING_VECTOR list;
int sel=0;
if (!m_IsPull)
list.push_back(_T("- all -"));
if(!g_Git.GetRemoteList(list))
{
if (!m_IsPull && list.size() <= 2)
list.erase(list.begin());
for (unsigned int i = 0; i < list.size(); ++i)
{
m_Remote.AddString(list[i]);
if (!m_bAllRemotes && list[i] == pullRemote)
sel = i;
}
}
m_Remote.SetCurSel(sel);
OnCbnSelchangeRemote();
}