当前位置: 首页>>代码示例>>C++>>正文


C++ CChars::RemoveFromStart方法代码示例

本文整理汇总了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;
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:33,代码来源:Files.cpp

示例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();
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:51,代码来源:ImageCelsSource.cpp

示例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;
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:94,代码来源:Preprocessor.cpp


注:本文中的CChars::RemoveFromStart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。