本文整理汇总了C++中CChars::Insert方法的典型用法代码示例。如果您正苦于以下问题:C++ CChars::Insert方法的具体用法?C++ CChars::Insert怎么用?C++ CChars::Insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChars
的用法示例。
在下文中一共展示了CChars::Insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DumpFroms
void CBaseObject::DumpFroms(void)
{
CChars sz;
int i;
int iNumEmbedded;
CEmbeddedObject* pcEmbedded;
int j;
int iNumHeapFroms;
CBaseObject* pcFromObject;
int iLength;
CChars szLine;
sz.Init();
sz.Append("-- ");
PrintObject(&sz);
sz.Append(" --\n");
iLength = sz.Length()-1;
szLine.Init('-', iLength);
szLine.AppendNewLine();
sz.Insert(0, &szLine);
sz.Append("Total Heap Froms [");
sz.Append(NumHeapFroms());
sz.Append("], ");
sz.Append("Stack Froms [");
sz.Append(NumStackFroms());
sz.Append("]\n");
iNumEmbedded = GetNumEmbedded();
for (i = 0; i < iNumEmbedded; i++)
{
pcEmbedded = GetEmbeddedObject(i);
iNumHeapFroms = pcEmbedded->CEmbeddedObject::NumHeapFroms();
sz.Append("Embedded ");
sz.Append(i);
sz.Append(" Heap Froms [");
sz.Append(iNumHeapFroms);
sz.Append("], ");
sz.Append("Stack Froms [");
sz.Append(pcEmbedded->CEmbeddedObject::NumStackFroms());
sz.Append("]\n");
for (j = 0; j < iNumHeapFroms; j++)
{
pcFromObject = pcEmbedded->GetHeapFrom(j);
sz.Append(" ");
pcFromObject->PrintObject(&sz);
sz.AppendNewLine();
}
}
sz.Append(&szLine);
szLine.Kill();
sz.Dump();
sz.Kill();
}
示例2: AddDirectory
BOOL CPackFiles::AddDirectory(char* szDirectory, char* szPackDirectory)
{
CFileUtil cFileUtil;
CArrayChars aszFileNames;
int i;
CChars* pszFileName;
CDiskFile cDiskFile;
CChars szName;
CChars szNameDirectory;
BOOL bResult;
BOOL bAnyFiles;
aszFileNames.Init();
bAnyFiles = cFileUtil.FindAllFiles(szDirectory, &aszFileNames, TRUE, FALSE);
if (!bAnyFiles)
{
aszFileNames.Kill();
return FALSE;
}
szNameDirectory.Init(szDirectory);
for (i = 0; i < aszFileNames.NumElements(); i++)
{
pszFileName = aszFileNames.Get(i);
cDiskFile.Init(pszFileName->Text());
cFileUtil.MakeNameFromDirectory(&szName, pszFileName, &szNameDirectory);
if (szPackDirectory)
{
szName.Insert(0, '/');
szName.Insert(0, szPackDirectory);
}
bResult = AddFile(&cDiskFile, szName.Text());
szName.Kill();
cDiskFile.Kill();
if (!bResult)
{
aszFileNames.Kill();
return FALSE;
}
}
aszFileNames.Kill();
return TRUE;
}
示例3: 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();
}
示例4: MethodToString
char* MethodToString(char* szFile, int iLine, char* szFunction)
{
int iCount = IncrementLogToStringCount();
char* sz = gaszLogToStringScratchPad[iCount];
CChars szOutput;
CFileUtil cFileUtil;
szOutput.Init();
szOutput.Append(szFile);
cFileUtil.RemovePath(&szOutput);
szOutput.Insert(0, '(');
szOutput.Append(':');
szOutput.Append(iLine);
szOutput.Append(") ");
szOutput.Append(szFunction);
StrCpySafe(sz, szOutput.Text(), LOG_TO_STRING_MAX_LENGTH);
szOutput.Kill();
return sz;
}
示例5: DumpPointerTos
void CBaseObject::DumpPointerTos(void)
{
CChars sz;
int i;
int iNumEmbedded;
CEmbeddedObject* pcEmbedded;
int j;
int iNumTos;
CEmbeddedObject** ppcToObject;
int iLength;
CChars szLine;
CArrayTemplateEmbeddedObjectPtr acTos;
CBaseObject* pcToObject;
int iTotalTos;
sz.Init();
sz.Append("-- ");
PrintObject(&sz);
sz.Append(" --\n");
iLength = sz.Length()-1;
szLine.Init('-', iLength);
szLine.AppendNewLine();
iTotalTos = 0;
iNumEmbedded = GetNumEmbedded();
for (i = 0; i < iNumEmbedded; i++)
{
pcEmbedded = GetEmbeddedObject(i);
iTotalTos += pcEmbedded->NumPointerTos();
}
sz.Insert(0, &szLine);
sz.Append("Total Tos [");
sz.Append(iTotalTos);
sz.Append("]\n");
for (i = 0; i < iNumEmbedded; i++)
{
pcEmbedded = GetEmbeddedObject(i);
acTos.Init(1);
pcEmbedded->BaseGetPointerTos(&acTos);
iNumTos = acTos.NumElements();
sz.Append("Embedded ");
sz.Append(i);
sz.Append(" Tos [");
sz.Append(iNumTos);
sz.Append("]\n");
for (j = 0; j < iNumTos; j++)
{
ppcToObject = acTos.Get(j); //A pointed to never comes back NULL.
sz.Append(" ");
if ((*ppcToObject)->IsBaseObject())
{
pcToObject = (CBaseObject*)*ppcToObject;
pcToObject->PrintObject(&sz);
}
else
{
sz.Append("HollwEmbeddedObject");
}
sz.AppendNewLine();
}
acTos.Kill();
}
sz.Append(&szLine);
szLine.Kill();
sz.Dump();
sz.Kill();
}