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


C++ CChars类代码示例

本文整理汇总了C++中CChars的典型用法代码示例。如果您正苦于以下问题:C++ CChars类的具体用法?C++ CChars怎么用?C++ CChars使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CChars类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Dump

void CDirectInputDetail::Dump(void)
{
	CChars		sz;

	sz.Init();
	sz.Append("Joystick ");
	sz.Append(": ");
	sz.Append(szID);
	sz.AppendNewLine();
	sz.Dump();
	sz.Kill();
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:12,代码来源:WinDirectInput.cpp

示例2: PrivateAssertNumber

BOOL PrivateAssertNumber(char* szExpected, CNumber* pcActual, int iLine, char* szFile)
{
	CNumber*	pcExpected;
	CChars		szExpectedAsChars;
	CChars		szActual;
	CChars		szFake;
	int			iIndex;
	int			iDecimals;
	BOOL		bResult;

	szFake.Fake(szExpected);
	iIndex = szFake.Find(0, '.');
	if (iIndex != -1)
	{
		iDecimals = szFake.Length() - iIndex;
	}
	else
	{
		iDecimals = 0;
	}

	pcExpected = gcNumberControl.Add(pcActual->mcMaxWholeNumbers, iDecimals);
	pcExpected->Init(szExpected, pcActual->mcMaxWholeNumbers, iDecimals);
	if (!pcExpected->Equals(pcActual))
	{
		pcExpected->ToString(&szExpectedAsChars);
		pcActual->ToString(&szActual);
		bResult = Fail(szExpectedAsChars.Text(), szActual.Text(), iLine, szFile);
		szExpectedAsChars.Kill();
		szActual.Kill();
	}
	else
	{
		bResult = Pass();
	}
	gcNumberControl.Remove();
	return bResult;
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:38,代码来源:Assert.cpp

示例3: CreateDefaultVirtualDesc

CInputVirtualDeviceDesc* CInputDeviceDesc::CreateDefaultVirtualDesc(void)
{
	CInputVirtualDeviceDesc*	pcVirtualDesc;
	SSetIterator				sIter;
	CInputSourceDesc*			pcSourceDesc;
	CInputDevices*				pcInputDevices;
	CChars						szTemp;

	pcInputDevices = GetInputDevices();

	szTemp.Init(mszFriendlyName.Text());
	szTemp.Append(" Default");
	pcVirtualDesc = pcInputDevices->CreateVirtualDeviceDescription(szTemp.Text(), TRUE);
	szTemp.Kill();

	pcSourceDesc = mlcInputs.StartIteration(&sIter);
	while (pcSourceDesc)
	{
		pcVirtualDesc->AddSource(pcSourceDesc, -1);
		pcSourceDesc = mlcInputs.Iterate(&sIter);
	}
	return pcVirtualDesc;
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:23,代码来源:InputDeviceDesc.cpp

示例4: Fake

void CChars::Fake(char* sz, int iStartInclusive, int iEndExclusive)
{
	char* pcPosition;

	if (iEndExclusive - iStartInclusive > 0)
	{
		pcPosition = (char*)RemapSinglePointer(sz, iStartInclusive);
		mcText.Fake(pcPosition, iEndExclusive - iStartInclusive + 1);
	}
	else
	{
		mcText.Fake(gszEmptyString.Text(), 1);
	}
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:14,代码来源:Chars.cpp

示例5:

void CLogger::Error2(char* szText, ...)
{
	va_list		vaMarker;
	char*		sz;
	CChars		szError;

	if (szText)
	{
		szError.Init(szText);
		va_start(vaMarker, szText);
		sz = va_arg(vaMarker, char*);
		while (sz != NULL)
		{
			szError.Append(sz);
			sz = va_arg(vaMarker, char*);
		}
		va_end(vaMarker);

		Error(szError.Text());
		szError.Kill();
	}
	else
	{
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:23,代码来源:Logger.cpp

示例6: DumpRawTokens

//////////////////////////////////////////////////////////////////////////
//																		//
//																		//
//////////////////////////////////////////////////////////////////////////
void CCBlockSet::DumpRawTokens(void)
{
	CChars			sz;
	int				iLast;

	iLast = 0;
	sz.Init();
	if (mbTextBlocks)
	{
		sz.Append("/* ------- text ");
		sz.Append(miLine);
		sz.Append(" ------- */\n");
	}
	else
	{
		sz.Append("/* ---- #directive ");
		sz.Append(miLine);
		sz.Append(" ---- */\n");
	}
	mcRawTokens.Append(&sz);
	sz.Dump();
	sz.Kill();
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:27,代码来源:CBlockSet.cpp

示例7: ProcessHashInclude

//////////////////////////////////////////////////////////////////////////
//																		//
//																		//
//////////////////////////////////////////////////////////////////////////
BOOL CPreprocessor::ProcessHashInclude(CPreprocessorTokenParser* pcParser)
{
	BOOL						bResult;
	CHeaderFile*				pcIncludeFile;
	CExternalString				cExternalString;
	CChars						sz;
	CHeaderNameMap*				pcHeaderNameMap;
	CHeaderNameMapDirectory*	pcNewDirectory;
	CHeaderNameMapDirectory*	pcCurrentDirectory;
	CChars						szPath;

	pcParser->SkipWhiteSpace();
	bResult = pcParser->GetStringDoubleQuoted(&cExternalString);
	if (!bResult)
	{
		bResult = pcParser->GetQuotedCharacterSequence('<', '>', &cExternalString);
		if (!bResult)
		{
			gcUserError.Set("Error in #include");
			return FALSE;
		}
	}

	FindBestInclude(&cExternalString, FALSE, &pcIncludeFile, &pcHeaderNameMap);
	if (pcIncludeFile)
	{
		pcNewDirectory = mcHeadersStack.Add();
		pcCurrentDirectory = mcHeadersStack.Get(mcHeadersStack.NumElements()-2);

		pcIncludeFile->Path(&szPath);
		pcNewDirectory->Init(pcHeaderNameMap, szPath.Text());
		szPath.Kill();

		bResult = PreprocessBlockSets(pcIncludeFile, mpcCurrentFile);

		pcNewDirectory = mcHeadersStack.Tail();
		pcNewDirectory->Kill();
		mcHeadersStack.Pop();
		return bResult;
	}

	sz.Init("Could not include file ");
	sz.AppendSubString(cExternalString.msz, cExternalString.EndInclusive()+1);
	gcUserError.Set(sz.Text());
	sz.Kill();
	return FALSE;
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:51,代码来源:Preprocessor.cpp

示例8: TestFileUtilMisc

void TestFileUtilMisc(void)
{
	CFileUtil	cFileUtil;
	BOOL		bResult;
	CChars		szPath;

	szPath.Init("TestFileUtil");
	bResult = cFileUtil.MakeDir(szPath.Text());
	AssertTrue(bResult);

	cFileUtil.AppendToPath(&szPath, "FileOfDoom.Indiana");
	bResult = cFileUtil.Touch(szPath.Text());
	AssertTrue(bResult);

	bResult = cFileUtil.Exists(szPath.Text());
	AssertTrue(bResult);

	cFileUtil.RemoveLastFromPath(&szPath);
	cFileUtil.AppendToPath(&szPath, "AnotherDir");
	bResult = cFileUtil.MakeDir(szPath.Text());
	AssertTrue(bResult);

	cFileUtil.RemoveLastFromPath(&szPath);
	cFileUtil.AppendToPath(&szPath, "Master.Chief");
	bResult = cFileUtil.Touch(szPath.Text());
	AssertTrue(bResult);

	bResult = cFileUtil.Delete(szPath.Text());
	AssertTrue(bResult);

	bResult = cFileUtil.Exists(szPath.Text());
	AssertFalse(bResult);

	cFileUtil.RemoveLastFromPath(&szPath);
	cFileUtil.RemoveDir(szPath.Text());
}
开发者ID:chrisjaquet,项目名称:Codaphela.Test,代码行数:36,代码来源:TestFileUtil.cpp

示例9: Dump

void CNamedIndexesBlock::Dump(void)
{
	CArrayBlock				avFakeBlock;
	CChars					szText;

	if (IsCached())
	{
		avFakeBlock.Fake(miBlockWidth, mpvCachePos, (int)miUsedBlocks, (int)miBlockChunkSize);
		Dump(&avFakeBlock);
	}
	else
	{
		szText.Init("--- Block(Not Cached) ---\n");
		szText.Append("(");
		szText.Append(mszFirst.Text());
		szText.Append(") -> (");
		szText.Append(mszLast.Text());
		szText.Append(")\n\n");
		szText.Dump();
		szText.Kill();
	}
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:22,代码来源:NamedIndexesBlock.cpp

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

示例11: ImportCelSource

BOOL CImageCelsSourceXML::ImportCelSource(CMarkupTag* pcBrushSourceTag, char* szTexturePath)
{
	CMarkupTag*			pcFileName;
	CChars				szFileName;
	CChars				szShortFileName;
	BOOL				bResult;
	CMarkupTag*			pcCels;
	CFileUtil			cFileUtil;

	pcFileName = CMarkupTextParser::GetTag(pcBrushSourceTag, "FileName");
	if (!pcFileName)
	{
		return FALSE;
	}

	szShortFileName.Init();
	pcFileName->GetText(&szShortFileName);
	if (szFileName.Empty())
	{
		szShortFileName.Kill();
		CMarkupTextParser::LogErrorTagWasEmpty(pcBrushSourceTag);
		return FALSE;
	}
	
	pcCels = CMarkupTextParser::GetTag(pcBrushSourceTag, "Cels");
	if (!pcCels)
	{
		szShortFileName.Kill();
		return FALSE;
	}

	szFileName.Init(szTexturePath);
	cFileUtil.AppendToPath(&szFileName, szShortFileName.Text());

	bResult = ImportCels(pcCels, szFileName.Text());
	return bResult;
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:37,代码来源:ImageCelsSourceXML.cpp

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

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

示例14: ValidatePointerTo

void CEmbeddedObject::ValidatePointerTo(CEmbeddedObject* pcPointedTo)
{
	CChars	szObject;
	CChars	szToObject;
	BOOL	bToPointsToFrom;

	bToPointsToFrom = pcPointedTo->ContainsFrom(this);
	if (!bToPointsToFrom)
	{
		szObject.Init();
		PrintObject(&szObject, IsEmbedded());
		szToObject.Init();
		pcPointedTo->PrintObject(&szToObject, pcPointedTo->IsEmbedded());
		gcLogger.Error2(__METHOD__, " Object {", szObject.Text(), "} pointing to object {", szToObject.Text(), "} does not have a from pointing to.", NULL);
		szToObject.Kill();
		szObject.Kill();
	}
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:18,代码来源:EmbeddedObject.cpp

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


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