本文整理汇总了C++中CChars::Replace方法的典型用法代码示例。如果您正苦于以下问题:C++ CChars::Replace方法的具体用法?C++ CChars::Replace怎么用?C++ CChars::Replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChars
的用法示例。
在下文中一共展示了CChars::Replace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddPackFile
//////////////////////////////////////////////////////////////////////////
// //
// //
//////////////////////////////////////////////////////////////////////////
BOOL CFiles::AddPackFile(CFileNodeSystemFile* pcFileNodeSystemFile)
{
CPackFileOffset* pcPackFiles;
char* szFullName;
CChars szPackFileOffset;
CChars* pszFullDirectory;
int iLength;
BOOL bResult;
int iRank;
pszFullDirectory = mcFileSystem.GetFullDirectoryName();
iLength = mszPackFilesExtension.Length()+1;
pcPackFiles = mcPackFilesArray.Add();
new(pcPackFiles) CPackFileOffset();
szFullName = pcFileNodeSystemFile->GetFullName();
szPackFileOffset.Init(szFullName);
szPackFileOffset.RemoveFromStart(pszFullDirectory->Length()+1);
szPackFileOffset.RemoveFromEnd(iLength);
szPackFileOffset.Replace('\\', '/');
iRank = szPackFileOffset.Count('/');
bResult = pcPackFiles->Init(szPackFileOffset.Text(), szFullName, iRank);
szPackFileOffset.Kill();
return bResult;
}
示例2: RecurseUnpack
BOOL CPackFiles::RecurseUnpack(CFileNodePackFileNode* pcNode, char* szDestination)
{
CChars szFileName;
CFileNodePackFileNode* pcChild;
int i;
CPackFileNode* pcFile;
BOOL bResult;
CPackFile* pcPackFile;
CFileCopier cCopier;
CDiskFile cDiskFile;
CFileUtil cFileUtil;
if (pcNode->IsDirectory())
{
bResult = TRUE;
for (i = 0; i < pcNode->Directory()->maNodeFiles.NumElements(); i++)
{
pcChild = (CFileNodePackFileNode*)pcNode->Directory()->maNodeFiles.Get(i);
bResult &= RecurseUnpack(pcChild, szDestination);
}
return bResult;
}
else if (pcNode->IsFile())
{
szFileName.Init(szDestination);
szFileName.Append('/');
pcNode->GetFullName(&szFileName);
szFileName.Replace('/', FILE_SEPARATOR[0]);
pcFile = pcNode->File();
pcPackFile = PackFile(this, pcFile);
if (!pcPackFile)
{
szFileName.Kill();
return FALSE;
}
cDiskFile.Init(szFileName.Text());
cFileUtil.RemoveLastFromPath(&szFileName);
cFileUtil.MakeDir(szFileName.Text());
bResult = cCopier.Copy(pcPackFile, &cDiskFile);
cDiskFile.Kill();
szFileName.Kill();
return bResult;
}
return FALSE;
}
示例3: FindBestInclude
//////////////////////////////////////////////////////////////////////////
// //
// //
//////////////////////////////////////////////////////////////////////////
void CPreprocessor::FindBestInclude(CExternalString* pcInclude, BOOL bSystemFile, CHeaderFile** ppcCFile, CHeaderNameMap** ppcHeaderNameMap)
{
CChars szInclude;
CHeaderFile* pcBestFile;
CHeaderNameMap* pcBestHeaderNameMap;
int iMatch;
int iBestMatch;
int i;
CHeaderNameMap* pcHeaderNameMap;
CHeaderFile** ppcHeaderFile;
CHeaderFile* pcHeaderFile;
CHeaderNameMapDirectory* pcCurrentDirectory;
CChars szPath;
szInclude.Init(pcInclude->msz, 0, pcInclude->miLen);
szInclude.Replace('\\', '/');
iBestMatch = 0;
pcBestFile = NULL;
pcBestHeaderNameMap = NULL;
for (i = 0; i < mcHeaderNames.NumElements(); i++)
{
pcHeaderNameMap = *mcHeaderNames.Get(i);
ppcHeaderFile = pcHeaderNameMap->mcFileNames.Get(szInclude.Text());
if (ppcHeaderFile)
{
pcHeaderFile = *ppcHeaderFile;
iMatch = 2;
if (pcHeaderFile->IsSystemFile() && bSystemFile)
{
iMatch += 2;
}
if (iMatch > iBestMatch)
{
iBestMatch = iMatch;
pcBestFile = pcHeaderFile;
pcBestHeaderNameMap = pcHeaderNameMap;
}
}
}
pcCurrentDirectory = mcHeadersStack.Tail();
if (pcCurrentDirectory)
{
for (i = 0; i < mcHeaderNames.NumElements(); i++)
{
pcHeaderNameMap = *mcHeaderNames.Get(i);
if (pcHeaderNameMap == pcCurrentDirectory->mpcHeaderNameMap)
{
if (pcCurrentDirectory->mszBaseDirectoryName.Length() > pcHeaderNameMap->mszBaseDirectory.Length())
{
szPath.Init(pcCurrentDirectory->mszBaseDirectoryName);
szPath.RemoveFromStart(pcHeaderNameMap->mszBaseDirectory.Length()+1);
szPath.Append('/');
szPath.Append(szInclude);
ppcHeaderFile = pcHeaderNameMap->mcFileNames.Get(szPath.Text());
if (ppcHeaderFile)
{
pcHeaderFile = *ppcHeaderFile;
iMatch = 2;
if (pcHeaderFile->IsSystemFile() && bSystemFile)
{
iMatch += 2;
}
if (iMatch > iBestMatch)
{
iBestMatch = iMatch;
pcBestFile = pcHeaderFile;
pcBestHeaderNameMap = pcHeaderNameMap;
}
}
szPath.Kill();
}
}
}
}
szInclude.Kill();
*ppcCFile = pcBestFile;
*ppcHeaderNameMap = pcBestHeaderNameMap;
}