本文整理汇总了C++中BYTE_VECTOR::findNextString方法的典型用法代码示例。如果您正苦于以下问题:C++ BYTE_VECTOR::findNextString方法的具体用法?C++ BYTE_VECTOR::findNextString怎么用?C++ BYTE_VECTOR::findNextString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BYTE_VECTOR
的用法示例。
在下文中一共展示了BYTE_VECTOR::findNextString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParserFromLsFile
int CTGitPathList::ParserFromLsFile(BYTE_VECTOR &out,bool /*staged*/)
{
int pos=0;
CString one;
CTGitPath path;
CString part;
this->Clear();
while (pos >= 0 && pos < (int)out.size())
{
one.Empty();
path.Reset();
CGit::StringAppend(&one, &out[pos], CP_UTF8);
int tabstart=0;
// m_Action is never used and propably never worked (needs to be set after path.SetFromGit)
// also dropped LOGACTIONS_CACHE for 'H'
// path.m_Action=path.ParserAction(out[pos]);
one.Tokenize(_T("\t"),tabstart);
if(tabstart>=0)
path.SetFromGit(one.Right(one.GetLength()-tabstart));
else
return -1;
tabstart=0;
part=one.Tokenize(_T(" "),tabstart); //Tag
if (tabstart < 0)
return -1;
part=one.Tokenize(_T(" "),tabstart); //Mode
if (tabstart < 0)
return -1;
part=one.Tokenize(_T(" "),tabstart); //Hash
if (tabstart < 0)
return -1;
part=one.Tokenize(_T("\t"),tabstart); //Stage
if (tabstart < 0)
return -1;
path.m_Stage=_ttol(part);
this->AddPath(path);
pos=out.findNextString(pos);
}
return 0;
}
示例2: ParserFromLog
//.........这里部分代码省略.........
if (existing != duplicateMap.end())
{
CTGitPath& p = m_paths[existing->second];
p.ParserAction(log[actionstart]);
if(merged)
p.m_Action |= CTGitPath::LOGACTIONS_MERGED;
m_Action |= p.m_Action;
}
else
{
int ac=path.ParserAction(log[actionstart] );
ac |= merged?CTGitPath::LOGACTIONS_MERGED:0;
path.SetFromGit(pathname1,&pathname2);
path.m_Action=ac;
//action must be set after setfromgit. SetFromGit will clear all status.
this->m_Action|=ac;
AddPath(path);
duplicateMap.insert(std::pair<CString, size_t>(path.GetGitPathString(), m_paths.size() - 1));
}
}
else
{
int tabstart=0;
path.Reset();
CString StatAdd;
CString StatDel;
CString file1;
CString file2;
tabstart=log.find('\t',pos);
if(tabstart >=0)
{
log[tabstart]=0;
CGit::StringAppend(&StatAdd, &log[pos], CP_UTF8);
pos=tabstart+1;
}
tabstart=log.find('\t',pos);
if(tabstart >=0)
{
log[tabstart]=0;
CGit::StringAppend(&StatDel, &log[pos], CP_UTF8);
pos=tabstart+1;
}
if(log[pos] == 0) //rename
{
++pos;
CGit::StringAppend(&file2, &log[pos], CP_UTF8);
int sec=log.find(0,pos);
if(sec>=0)
{
++sec;
CGit::StringAppend(&file1, &log[sec], CP_UTF8);
}
pos=sec;
}
else
{
CGit::StringAppend(&file1, &log[pos], CP_UTF8);
}
path.SetFromGit(file1,&file2);
auto existing = duplicateMap.find(path.GetGitPathString());
if (existing != duplicateMap.end())
{
CTGitPath& p = m_paths[existing->second];
p.m_StatAdd = StatAdd;
p.m_StatDel = StatDel;
}
else
{
//path.SetFromGit(pathname);
if (parseDeletes)
{
path.m_StatAdd=_T("0");
path.m_StatDel=_T("0");
path.m_Action |= CTGitPath::LOGACTIONS_DELETED | CTGitPath::LOGACTIONS_MISSING;
}
else
{
path.m_StatAdd=StatAdd;
path.m_StatDel=StatDel;
}
AddPath(path);
duplicateMap.insert(std::pair<CString, size_t>(path.GetGitPathString(), m_paths.size() - 1));
}
}
pos=log.findNextString(pos);
}
return 0;
}