本文整理汇总了C++中CChars::RemoveFromStart方法的典型用法代码示例。如果您正苦于以下问题:C++ CChars::RemoveFromStart方法的具体用法?C++ CChars::RemoveFromStart怎么用?C++ CChars::RemoveFromStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChars
的用法示例。
在下文中一共展示了CChars::RemoveFromStart方法的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: AddDiskFileSources
void CImageCelsSource::AddDiskFileSources(char* szPathName, char* szFileNameContains, char* szImageName, CImageCelSource* pcCelSource)
{
CFileUtil cFileUtil;
CArrayString cFileNames;
int i;
CChars* pszName;
CImageSourceDiskFile* pcDiskFile;
CChars szNiceName;
int iIndex;
int iLen;
if (!szFileNameContains)
{
return;
}
iLen = (int)strlen(szFileNameContains);
if (iLen == 0)
{
return;
}
cFileNames.Init(32);
cFileUtil.FindFilesWithNameContaining(szPathName, szFileNameContains, &cFileNames, FALSE);
for (i = 0; i < cFileNames.NumElements(); i++)
{
pszName = cFileNames.Get(i);
pcDiskFile = UMalloc(CImageSourceDiskFile);
if (szImageName)
{
szNiceName.Init(*pszName);
cFileUtil.RemovePath(&szNiceName);
cFileUtil.RemoveExtension(&szNiceName);
iIndex = szNiceName.Find(0, szFileNameContains);
iIndex += iLen;
szNiceName.RemoveFromStart(iIndex);
szNiceName.Insert(0, szImageName);
pcDiskFile->Init(pszName->Text(), szNiceName.Text());
szNiceName.Kill();
}
else
{
pcDiskFile->Init(pszName->Text());
}
AddSource(pcDiskFile, pcCelSource);
}
cFileNames.Kill();
}
示例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;
}