本文整理汇总了C++中STRING_VECTOR::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ STRING_VECTOR::clear方法的具体用法?C++ STRING_VECTOR::clear怎么用?C++ STRING_VECTOR::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STRING_VECTOR
的用法示例。
在下文中一共展示了STRING_VECTOR::clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
if(!g_Git.GetRemoteList(list))
{
if (list.size() > 1)
m_Remote.AddString(CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)));
for (unsigned int i = 0; i < list.size(); ++i)
{
m_Remote.AddString(list[i]);
if(list[i] == remote)
sel = i + (list.size() > 1 ? 1 : 0);
}
}
else
MessageBox(g_Git.GetGitLastErr(_T("Could not get list of remotes.")), _T("TortoiseGit"), MB_ICONERROR);
// 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 = -1;
list.clear();
m_BranchSource.Reset();
m_BranchSource.SetMaxHistoryItems(0x7FFFFFFF);
if(!g_Git.GetBranchList(list,¤t))
m_BranchSource.SetList(list);
else
MessageBox(g_Git.GetGitLastErr(_T("Could not get list of local branches.")), _T("TortoiseGit"), MB_ICONERROR);
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);
if (list.size() > 1 && m_bPushAllRemotes)
m_Remote.SetCurSel(0);
m_bPushAllRemotes = FALSE; // reset to FALSE, so that a refresh does not reselect all even if it was already deselected by user; correct value will be set in OnBnClickedOk method
}
示例2: 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);
}
示例3: LoadBranchInfo
void CRebaseDlg::LoadBranchInfo()
{
m_BranchCtrl.SetMaxHistoryItems(0x7FFFFFFF);
m_UpstreamCtrl.SetMaxHistoryItems(0x7FFFFFFF);
STRING_VECTOR list;
list.clear();
int current;
g_Git.GetBranchList(list,¤t,CGit::BRANCH_ALL);
m_BranchCtrl.AddString(list);
list.clear();
g_Git.GetBranchList(list,¤t,CGit::BRANCH_ALL_F);
m_UpstreamCtrl.AddString(list);
m_BranchCtrl.SetCurSel(current);
AddBranchToolTips(&m_BranchCtrl);
AddBranchToolTips(&m_UpstreamCtrl);
if(!m_Upstream.IsEmpty())
{
m_UpstreamCtrl.AddString(m_Upstream);
m_UpstreamCtrl.SetCurSel(m_UpstreamCtrl.GetCount()-1);
}
else
{
//Select pull-remote from current branch
CString currentBranch = g_Git.GetSymbolicRef();
CString configName;
configName.Format(L"branch.%s.remote", currentBranch);
CString pullRemote = g_Git.GetConfigValue(configName);
//Select pull-branch from current branch
configName.Format(L"branch.%s.merge", currentBranch);
CString pullBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
CString defaultUpstream;
defaultUpstream.Format(L"remotes/%s/%s", pullRemote, pullBranch);
int found = m_UpstreamCtrl.FindStringExact(0, defaultUpstream);
if(found >= 0)
m_UpstreamCtrl.SetCurSel(found);
}
}
示例4: OnInitDialog
BOOL CBisectStartDlg::OnInitDialog()
{
CHorizontalResizableStandAloneDialog::OnInitDialog();
CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
AddAnchor(IDHELP, BOTTOM_RIGHT);
AddAnchor(IDC_BUTTON_GOOD, TOP_RIGHT);
AddAnchor(IDC_BUTTON_BAD, TOP_RIGHT);
AddAnchor(IDC_COMBOBOXEX_GOOD, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_COMBOBOXEX_BAD, TOP_LEFT, TOP_RIGHT);
EnableSaveRestore(_T("BisectStartDlg"));
CString sWindowTitle;
GetWindowText(sWindowTitle);
CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle);
STRING_VECTOR list;
int current;
g_Git.GetBranchList(list, ¤t, CGit::BRANCH_ALL);
m_cLastGoodRevision.SetMaxHistoryItems(0x7FFFFFFF);
m_cFirstBadRevision.SetMaxHistoryItems(0x7FFFFFFF);
for (unsigned int i = 0; i < list.size(); ++i)
{
m_cLastGoodRevision.AddString(list[i]);
m_cFirstBadRevision.AddString(list[i]);
}
list.clear();
g_Git.GetTagList(list);
for (unsigned int i = 0; i < list.size(); ++i)
{
m_cLastGoodRevision.AddString(list[i]);
m_cFirstBadRevision.AddString(list[i]);
}
if (m_sLastGood.IsEmpty())
m_cLastGoodRevision.SetCurSel(-1);
else
m_cLastGoodRevision.SetWindowTextW(m_sLastGood);
if (m_sFirstBad.IsEmpty())
m_cFirstBadRevision.SetCurSel(current);
else
m_cFirstBadRevision.SetWindowTextW(m_sFirstBad);
this->UpdateData(FALSE);
// EnDisable OK Button
OnChangedRevision();
return TRUE;
}
示例5: 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=0;
STRING_VECTOR list;
m_Remote.Reset();
if(!g_Git.GetRemoteList(list))
{
for(unsigned int i=0;i<list.size();i++)
{
m_Remote.AddString(list[i]);
if(list[i] == remote)
sel = i;
}
}
m_Remote.SetCurSel(sel);
int current=0;
list.clear();
m_BranchSource.Reset();
m_BranchSource.SetMaxHistoryItems(0x7FFFFFFF);
if(!g_Git.GetBranchList(list,¤t))
{
for(unsigned int i=0;i<list.size();i++)
m_BranchSource.AddString(list[i]);
}
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);
}