本文整理汇总了C++中CChars::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ CChars::Append方法的具体用法?C++ CChars::Append怎么用?C++ CChars::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChars
的用法示例。
在下文中一共展示了CChars::Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Eval
CNumber CCalculator::Eval(char* szText)
{
CCalcExpression* pcExpression;
CNumber cAnswer;
BOOL bResult;
CChars sz;
mcParser.Init(szText);
bResult = Expression(&pcExpression);
mcParser.Kill();
if (bResult)
{
cAnswer = pcExpression->Evaluate();
SafeKill(pcExpression);
}
else
{
sz.Init("Cannot evaluate expression [");
sz.Append(szText);
sz.Append("]\n");
gcUserError.Set(sz.Text());
sz.Kill();
cAnswer.Zero();
}
return cAnswer;
}
示例2: QuoteTokens
//////////////////////////////////////////////////////////////////////////
// //
// //
//////////////////////////////////////////////////////////////////////////
CPPToken* CPreprocessor::QuoteTokens(CPPTokenHolder* pcDest, CPPAbstractHolder* pcHolder)
{
int j;
BOOL bQuoteNextReplacement;
CChars szQuoted;
char* szInStrings;
CPPText* pcQuoted;
CPPToken* pcToken;
szQuoted.Init(100);
szQuoted.Append('"');
for (j = 0; j < pcHolder->mcTokens.mcArray.NumElements(); j++)
{
pcToken = *(pcHolder->mcTokens.mcArray.Get(j));
pcToken->Append(&szQuoted);
}
szQuoted.Append('"');
bQuoteNextReplacement = FALSE;
szInStrings = (char*)gcTokenStrings.Add(szQuoted.Length()+1);
memcpy(szInStrings, szQuoted.Text(), szQuoted.Length()+1);
pcQuoted = CPPText::Construct(mpcStack->Add(sizeof(CPPText)));
pcQuoted->Init(PPT_DoubleQuoted, -1, -1, szInStrings, szInStrings+szQuoted.Length());
pcDest->Add((CPPToken**)&pcQuoted);
szQuoted.Kill();
return pcQuoted;
}
示例3: Begin
BOOL CObjectWriterChunked::Begin(void)
{
CDiskFile* pcDiskFile;
CFileUtil cFileUtil;
CChars szFullDirectory;
CChars szFileName;
CObjectWriter::Begin();
szFullDirectory.Init(mszDirectory);
cFileUtil.AppendToPath(&szFullDirectory, mszObjectBaseName.Text());
cFileUtil.MakeDir(szFullDirectory.Text());
szFileName.Init(szFullDirectory);
szFullDirectory.Kill();
cFileUtil.AppendToPath(&szFileName, mszFileName.Text());
szFileName.Append(".");
szFileName.Append(OBJECT_FILE_EXTENSION);
pcDiskFile = DiskFile(szFileName.Text());
szFileName.Kill();
mcChunkFile.Init(pcDiskFile);
return mcChunkFile.WriteOpen(CHUNKED_OBJECT_FILE);
}
示例4: CreateLinkNodes
BOOL CMeshConverter::CreateLinkNodes(void)
{
int i;
CConnection* pcConnection;
SFloat4x4* psWorldMatrix;
SFloat4x4* psMatrix;
float fDeterminant;
CMeshObjectNode* pcLinkNode;
int iConnectionIndex;
//Link nodes are created here so that the reference meshes matricies can be whatevered.
mpcConnectionsAndIndices->Get(0, (void**)&pcConnection, &iConnectionIndex);
if (pcConnection)
{
psWorldMatrix = (SFloat4x4*)&pcConnection->msWorldMatrix;
for (i = 1; i < mpcConnectionsAndIndices->NumElements(); i++)
{
mpcConnectionsAndIndices->Get(i, (void**)&pcConnection, &iConnectionIndex);
psMatrix = (SFloat4x4*)&pcConnection->msWorldMatrix;
if (i == 1)
{
pcLinkNode = mpcMeshObject->GetNodes()->InsertBeforeHead();
}
else
{
pcLinkNode = mpcMeshObject->GetNodes()->InsertAfterNode(pcLinkNode);
}
pcLinkNode->psToSubObjectSpaceFromZeroSpace = mpcSceneConverter->GetWorld()->CreateMatrix();
pcLinkNode->psToZeroSpaceFromSubObjectSpace = mpcSceneConverter->GetWorld()->CreateMatrix();
if (Float4x4Inverse(&pcLinkNode->psToSubObjectSpaceFromZeroSpace->sD3DMatrix, &fDeterminant, psMatrix) == NULL)
{
gcUserError.Set("Matrix has no inverse");
return FALSE;
}
}
return TRUE;
}
else
{
CChars sz;
sz.Init("The Mesh [");
sz.Append(mpcMesh->GetName());
sz.Append("] has no Connection (root node matrix).");
gcUserError.Set(sz.Text());
sz.Kill();
return FALSE;
}
}
示例5: Dump
void CDirectInputDetail::Dump(void)
{
CChars sz;
sz.Init();
sz.Append("Joystick ");
sz.Append(": ");
sz.Append(szID);
sz.AppendNewLine();
sz.Dump();
sz.Kill();
}
示例6: EndingWinloop
void CWindow::EndingWinloop(char* szReason)
{
CChars szShutdown;
mcLoopTimer.Update();
szShutdown.Init("Shutdown winloop [");
szShutdown.Append(szReason);
szShutdown.Append("] - ");
mcLoopTimer.HumanReadable(&szShutdown);
mcLoopTimer.Kill();
szShutdown.AppendNewLine();
gcLogger.Add(szShutdown.Text());
}
示例7: Dump
void CNamedIndexesBlock::Dump(CArrayBlock* pavFakeBlock)
{
int i;
CNamedIndexedBlock* pvcBlock;
CChars szText;
szText.Init("--- Block(");
szText.Append(pavFakeBlock->NumElements());
szText.Append(") ---\n");
szText.Append("(");
szText.Append(mszFirst.Text());
szText.Append(") -> (");
szText.Append(mszLast.Text());
szText.Append(")\n");
for (i = 0; i < pavFakeBlock->NumElements(); i++)
{
pvcBlock = (CNamedIndexedBlock*)pavFakeBlock->Get(i);
szText.Append(pvcBlock->Name());
szText.AppendNewLine();
}
szText.AppendNewLine();
szText.Dump();
szText.Kill();
}
示例8: Dump
void CInputDeviceDesc::Dump(void)
{
CTextFile cFile;
CChars szName;
cFile.Init();
ToString(&cFile.mcText);
szName.Init("../");
szName.Append(mszFriendlyName.Text());
szName.Append(".txt");
cFile.Write(szName.Text());
szName.Kill();
cFile.Kill();
}
示例9: CreateDefaultVirtualDeviceFromThis
CInputVirtualDevice* CInputDevice::CreateDefaultVirtualDeviceFromThis(char* szName)
{
CInputVirtualDevice* pcVirtual;
SSetIterator sIter;
CInputSourceDesc* pcSource;
CInputDevices* pcInputDevices;
CChars szTemp;
pcInputDevices = GetInputDevices();
if (szName)
{
szTemp.Init(szName);
}
else
{
szTemp.Init(mszFriendlyName.Text());
szTemp.Append(" Default");
}
pcVirtual = pcInputDevices->CreateVirtualDevice(szTemp.Text());
szTemp.Kill();
pcSource = mpcDesc->StartInputsIteration(&sIter);
while (pcSource)
{
pcVirtual->AddSource(this, pcSource);
pcSource = mpcDesc->IterateInputs(&sIter);
}
pcVirtual->DoneAddingSources();
pcInputDevices->UpdateCommonality();
return pcVirtual;
}
示例10: CreateVariableVirtualDeviceFromThis
CInputVirtualDevice* CInputDevice::CreateVariableVirtualDeviceFromThis(CInputActions* pcInputActions)
{
CInputVirtualDevice* pcVirtual;
CInputSourceDesc* pcSource;
CInputDevices* pcInputDevices;
CChars szTemp;
CArrayIntAndPointer apcSourceDescs;
int i;
pcInputDevices = GetInputDevices();
szTemp.Init(mszFriendlyName.Text());
szTemp.Append(" Variable");
pcVirtual = pcInputDevices->CreateVirtualDevice(szTemp.Text());
szTemp.Kill();
mcVariables.SetChords(pcVirtual->GetChords());
apcSourceDescs.Init(8);
mpcDesc->GetVariableChordDescs()->GetInputSourceDescs(&apcSourceDescs, mpcDesc);
for (i = 0; i < apcSourceDescs.NumElements(); i++)
{
pcSource = (CInputSourceDesc*)apcSourceDescs.GetPtr(i);
pcVirtual->AddSource(this, pcSource);
}
apcSourceDescs.Kill();
pcVirtual->DoneAddingSources();
GetInputDevices()->AddChords(pcVirtual, mpcDesc->GetVariableChordDescs(), this);
pcInputDevices->UpdateCommonality();
pcVirtual->Unstoppable();
return pcVirtual;
}
示例11: DumpAddDetail
void CUnknowns::DumpAddDetail(CUnknown* pcUnknown)
{
SMemoryAllocation* psAlloc;
CChars sz;
psAlloc = MEMORY_GET_ALLOCATION(pcUnknown);
if (!IsFreed(pcUnknown))
{
sz.Init("Size: ");
sz.Append(psAlloc->uiSize);
sz.AppendNewLine();
sz.Append("AllocCount: ");
sz.Append(psAlloc->uiAllocCount);
sz.AppendNewLine();
sz.Append("DebugName: ");
sz.Append(psAlloc->szDebug, 4);
sz.AppendNewLine();
sz.Dump();
sz.Kill();
}
else
{
sz.Init("Freed CUnknown.\n");
sz.Append("AllocCount: ");
sz.Append(psAlloc->uiAllocCount);
sz.AppendNewLine();
sz.Dump();
sz.Kill();
}
}
示例12: AddFile
CTranslationUnit* CTranslationUnitFileArray::AddFile(char* szRelativeFileName, BOOL bLogIncludes, BOOL bLogBlocks)
{
CChars szTemp;
CTranslationUnit* pcTranslationUnit;
CTranslationUnit cTranslationUnit;
szTemp.Init(mpcLibrary->mszBaseDir);
szTemp.Append(FILE_SEPARATOR);
szTemp.Append(szRelativeFileName);
cTranslationUnit.Init(8, szTemp.Text(), mpcLibrary, bLogIncludes, bLogBlocks);
szTemp.Kill();
pcTranslationUnit = mcFiles.InsertAfterTail();
memcpy(pcTranslationUnit, &cTranslationUnit, sizeof(CTranslationUnit));
pcTranslationUnit->macBlockSets.mpcFile = pcTranslationUnit;
return pcTranslationUnit;
}
示例13: ValidateEmpty
void CObjects::ValidateEmpty(void)
{
OIndex iNumIndexed;
iNumIndexed = mcMemory.NumIndexed();
if (iNumIndexed != 0)
{
CChars sz;
sz.Init("\n");
sz.Append("Memory not empty. ");
sz.Append(iNumIndexed);
sz.Append(" objects are still indexed.\n");
PrintMemory(&sz);
gcLogger.Error(sz.Text());
sz.Kill();
}
}
示例14: DumpIndex
void CObjects::DumpIndex(void)
{
CChars sz;
sz.Init("-------------------------- Indices -------------------------- \n");
PrintMemory(&sz);
sz.Append("------------------------------------------------------------ \n");
sz.Dump();
sz.Kill();
}
示例15: LogIncludes
//////////////////////////////////////////////////////////////////////////
// //
// //
//////////////////////////////////////////////////////////////////////////
void CPreprocessor::LogIncludes(CCFile* pcFile)
{
CChars sz;
if (mbLogInlucdes)
{
sz.Init();
sz.Append(' ', miIncludeDepth*4);
sz.Append(" ");
sz.Append(pcFile->ShortName());
sz.Append("\n");
if (mbDumpLogs)
{
sz.Dump();
}
mpszIncludesLog->Append(sz);
sz.Kill();
}
}