本文整理汇总了C++中StrBuf::Value方法的典型用法代码示例。如果您正苦于以下问题:C++ StrBuf::Value方法的具体用法?C++ StrBuf::Value怎么用?C++ StrBuf::Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrBuf
的用法示例。
在下文中一共展示了StrBuf::Value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDeleteSelected
void CForceSyncDlg::OnDeleteSelected()
{
CString filename;
POSITION pos;
POSITION oldPos;
for(int i=m_List.GetCount()-1; i>=0; i--)
{
if(m_List.GetSel(i))
{
m_List.GetText(i, filename);
if (filename.FindOneOf(_T("@#%")) != -1)
{
StrBuf b;
StrBuf f;
f << CharFromCString(filename);
StrPtr *p = &f;
StrOps::WildToStr(*p, b);
filename = CharToCString(b.Value());
}
for(pos = m_lpCstrListC->GetHeadPosition(); pos != NULL; )
{
oldPos = pos;
if (filename == m_lpCstrListC->GetNext(pos))
{
m_lpCstrListC->RemoveAt(oldPos);
m_List.DeleteString(i);
continue;
}
}
for(pos = m_lpCstrListD->GetHeadPosition(); pos != NULL; )
{
oldPos = pos;
if (filename == m_lpCstrListD->GetNext(pos))
{
m_lpCstrListD->RemoveAt(oldPos);
m_List.DeleteString(i);
break;
}
}
}
}
m_Delete.EnableWindow(FALSE);
}
示例2: OnInitDialog
BOOL CForceSyncDlg::OnInitDialog()
{
CDialog::OnInitDialog();
GetWindowRect(&m_InitRect);
m_LastRect = m_InitRect;
CString filename;
CString filenmok;
POSITION pos;
BOOL bWeird = FALSE;
CStringList strlist;
for(pos = m_lpCstrListC->GetHeadPosition(); pos != NULL; )
{
filename = m_lpCstrListC->GetNext(pos);
if (filename.FindOneOf(_T("@#%")) != -1)
{
StrBuf b;
StrBuf f;
f << CharFromCString(filename);
StrPtr *p = &f;
StrOps::WildToStr(*p, b);
filenmok = CharToCString(b.Value());
bWeird = TRUE;
}
m_List.AddString(filename);
strlist.AddTail(filenmok);
}
if (bWeird)
{
m_lpCstrListC->RemoveAll();
for(pos = strlist.GetHeadPosition(); pos != NULL; )
m_lpCstrListC->AddTail(strlist.GetNext(pos));
}
bWeird = FALSE;
strlist.RemoveAll();
for(pos = m_lpCstrListD->GetHeadPosition(); pos != NULL; )
{
filename = m_lpCstrListD->GetNext(pos);
if (filename.FindOneOf(_T("@#%")) != -1)
{
StrBuf b;
StrBuf f;
f << CharFromCString(filename);
StrPtr *p = &f;
StrOps::WildToStr(*p, b);
filenmok = CharToCString(b.Value());
bWeird = TRUE;
}
m_List.AddString(filename);
strlist.AddTail(filenmok);
}
if (bWeird)
{
m_lpCstrListD->RemoveAll();
for(pos = strlist.GetHeadPosition(); pos != NULL; )
m_lpCstrListD->AddTail(strlist.GetNext(pos));
}
/////////////////////////////
// Fill in the change list, if present, and select the suggested
// change number
if(!m_pChangeList.IsEmpty())
{
ASSERT(m_pChangeList.GetCount() > 0);
for(pos=m_pChangeList.GetHeadPosition(); pos != NULL; )
{
m_ChangeCombo.AddString(m_pChangeList.GetNext(pos));
}
}
int index;
ASSERT(!m_SelChange.IsEmpty());
if( (index=m_ChangeCombo.FindStringExact(-1, m_SelChange))==CB_ERR)
{
ASSERT(0); //Why wasnt default value in list?
index=0;
}
m_ChangeCombo.SetCurSel(index);
m_Delete.ShowWindow(SW_SHOWNOACTIVATE);
m_Delete.EnableWindow(FALSE);
m_OK.EnableWindow(FALSE);
m_ChangeCombo.EnableWindow(FALSE);
hWndThis = m_hWnd;
RECT rect;
m_List.GetWindowRect(&rect);
adjX = rect.left;
adjY = rect.top;
adjX -= m_InitRect.left;
adjY -= m_InitRect.top;
m_List.SetRightClkCallback((PTRFUNC)OnRightClickList);
// Restore window position
m_InitDialogDone = TRUE;
m_WinPos.RestoreWindowPosition();
return TRUE; // return TRUE unless you set the focus to a control
//.........这里部分代码省略.........
示例3: OnDiffFile
void CForceSyncDlg::OnDiffFile(BOOL bHave)
{
CString filename;
m_StringList.RemoveAll();
for(int i=m_List.GetCount()-1; i>=0; i--)
{
if(!m_List.GetSel(i))
continue;
m_List.GetText(i, filename);
if (filename.FindOneOf(_T("@#%")) != -1)
{
StrBuf b;
StrBuf f;
f << CharFromCString(filename);
StrPtr *p = &f;
StrOps::WildToStr(*p, b);
filename = CharToCString(b.Value());
}
BOOL b = TRUE;
for(POSITION pos = m_lpCstrListD->GetHeadPosition(); pos != NULL; )
{
if (filename == m_lpCstrListD->GetNext(pos))
{
CString txt;
txt.FormatMessage(IDS_s_IS_MISSING, filename);
AddToStatus(txt, SV_MSG);
b = FALSE;
break;
}
}
if (b)
m_StringList.AddTail(filename);
}
if (!m_StringList.GetCount())
{
if (m_List.GetSelCount() > 1)
AddToStatus(LoadStringResource(IDS_ALLSELFILESAREMISSING_NODIFFRUN), SV_COMPLETION);
return;
}
if (bHave)
{
int cnt = m_StringList.GetCount();
CCmd_Fstat *pCmd2= new CCmd_Fstat;
pCmd2->Init(NULL, RUN_SYNC);
if( pCmd2->Run( FALSE, &m_StringList, TRUE, 0 ) && !pCmd2->GetError() )
{
m_StringList.RemoveAll();
CObList *coblist2 = pCmd2->GetFileList( );
ASSERT_KINDOF( CObList, coblist2 );
ASSERT( coblist2->GetCount() == cnt );
for (POSITION pos = coblist2->GetHeadPosition( ); pos != NULL; )
{
CP4FileStats *stats = ( CP4FileStats * )coblist2->GetNext( pos );
ASSERT_KINDOF( CP4FileStats, stats );
long headRev = stats->GetHeadRev();
long haveRev = stats->GetHaveRev();
CString filename = stats->GetFullDepotPath();
if (headRev != haveRev)
{
CString revnbr;
revnbr.Format(_T("#%ld"), haveRev);
filename += revnbr;
}
m_StringList.AddTail(filename);
delete stats;
}
}
delete pCmd2;
}
CCmd_Diff *pCmd= new CCmd_Diff;
pCmd->Init( m_hWnd, RUN_ASYNC);
if( pCmd->Run( &m_StringList, _T("-f") ) )
MainFrame()->UpdateStatus( LoadStringResource(IDS_DIFFING_FILE) );
else
delete pCmd;
}