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


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

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


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

示例1: ValidateObjectsThisIn

void CBaseObject::ValidateObjectsThisIn(void)
{
	CChars			sz;

	if (IsEmbedded())
	{
		if (mpcObjectsThisIn != NULL)
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should not have ObjectsThisIn [", PointerToString(mpcObjectsThisIn), "] set.", NULL);
			sz.Kill();
		}
	}
	else
	{
		if (mpcObjectsThisIn == NULL)
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should have ObjectsThisIn [NULL] set.", NULL);
			sz.Kill();
		}
	}
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:25,代码来源:BaseObject.cpp

示例2: ValidateIndex

void CBaseObject::ValidateIndex(void)
{
	CChars			sz;

	if (IsEmbedded())
	{
		if (moi != INVALID_O_INDEX)
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should have an Index [", IndexToString(moi), "] of INVALID_O_INDEX [", IndexToString(INVALID_O_INDEX),"].", NULL);
			sz.Kill();
		}
	}
	else
	{
		if (moi == INVALID_O_INDEX)
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should not have an Index of INVALID_O_INDEX [", IndexToString(INVALID_O_INDEX),"].", NULL);
			sz.Kill();
		}
	}
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:25,代码来源:BaseObject.cpp

示例3: ValidateFrom

void CEmbeddedObject::ValidateFrom(CBaseObject* pcBaseObject)
{
	CChars	szObject;
	CChars	szFromObject;
	int		iThisDistToRoot;
	int		iOtherDistToRoot;
	BOOL	bFromPointsTo;

	iThisDistToRoot = GetDistToRoot();
	iOtherDistToRoot = pcBaseObject->GetDistToRoot();
	if ((iThisDistToRoot >= ROOT_DIST_TO_ROOT && iOtherDistToRoot >= ROOT_DIST_TO_ROOT) && (iOtherDistToRoot < iThisDistToRoot - 1))
	{
		szObject.Init();
		PrintObject(&szObject, IsEmbedded());
		szFromObject.Init();
		pcBaseObject->PrintObject(&szFromObject, pcBaseObject->IsEmbedded());
		gcLogger.Error2(__METHOD__, " Object {", szObject.Text(), "} pointed to from object {", szFromObject.Text(), "} cannot have a DistToRoot that is different by more than 1.", NULL);
		szFromObject.Kill();
		szObject.Kill();
	}

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

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

示例5: ValidateDistToRoot

void CBaseObject::ValidateDistToRoot(void)
{
	CChars			sz;
	CBaseObject*	pcContainer;

	if (!((miDistToRoot >= ROOT_DIST_TO_ROOT) || (miDistToRoot == UNATTACHED_DIST_TO_ROOT)))
	{
		sz.Init();
		PrintObject(&sz, IsEmbedded());
		gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should not have a dist to root of [", IntToString(miDistToRoot), "].", NULL);
		sz.Kill();
	}

	if (IsEmbedded())
	{
		pcContainer = GetEmbeddingContainer();
		if (pcContainer->GetDistToRoot() != GetDistToRoot())
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should have a dist to root [", IntToString(miDistToRoot), "] the same as it's embedding object [", IntToString(pcContainer->GetDistToRoot()),"].", NULL);
			sz.Kill();
		}
	}
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:25,代码来源:BaseObject.cpp

示例6: ValidateCanFindRoot

void CBaseObject::ValidateCanFindRoot(void)
{
	ValidateNotEmbedded(__METHOD__);

	CChars			sz;
	BOOL			bCanFindRoot;

	if (miDistToRoot > ROOT_DIST_TO_ROOT)
	{
		bCanFindRoot = CanFindRoot();

		if (!bCanFindRoot)
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} has a positive dist to root and should be able to find the Root object.", NULL);
			sz.Kill();
		}
	}
	else if (miDistToRoot == ROOT_DIST_TO_ROOT)
	{
		if (!IsRoot())
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} has a dist to root [0] but is not the Root object.", NULL);
			sz.Kill();
		}
	}
	else if (miDistToRoot == UNATTACHED_DIST_TO_ROOT)
	{
		bCanFindRoot = CanFindRoot();

		if (bCanFindRoot)
		{
			sz.Init();
			PrintObject(&sz, IsEmbedded());
			gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} has an [UNATTACHED_DIST_TO_ROOT] dist to root should not be able to find the Root object.", NULL);
			sz.Kill();
		}
	}
	else if (miDistToRoot == CLEARED_DIST_TO_ROOT)
	{
		sz.Init();
		PrintObject(&sz, IsEmbedded());
		gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should not have dist to root [CLEARED_DIST_TO_ROOT].", NULL);
		sz.Kill();
	}
	else
	{
		sz.Init();
		PrintObject(&sz, IsEmbedded());
		gcLogger.Error2(__METHOD__, " Object {", sz.Text(), "} should not have dist to root [", IntToString(miDistToRoot), "].", NULL);
		sz.Kill();
	}
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:56,代码来源:BaseObject.cpp

示例7: TestFileUtilNaming

void TestFileUtilNaming(void)
{
	CFileUtil	cFileUtil;
	CChars		sz;
	CChars		szExpected;

	sz.Init();
	cFileUtil.FullPath(&sz);
	sz.LowerCase();
	szExpected.Init("C:\\GameEngine\\Test\\TestBaseLib\\TestBaseLib");
	szExpected.LowerCase();
	AssertString(szExpected.Text(), sz.Text());
	szExpected.Kill();
	sz.Kill();

	sz.Init("c:\\Documents and Settings\\Joe\\..\\..\\");
	cFileUtil.CollapsePath(&sz);
	AssertStringCase("C:\\", sz.Text(), FALSE);
	sz.Kill();

	sz.Init("\\Documents\\and\\Settings\\..\\..\\Joe");
	cFileUtil.CollapsePath(&sz);
	AssertString("\\Documents\\Joe", sz.Text());
	sz.Kill();

	sz.Init("\\Documents\\and\\Settings\\..\\..\\Joe\\");
	cFileUtil.CollapsePath(&sz);
	AssertString("\\Documents\\Joe", sz.Text());
	sz.Kill();

	sz.Init(".\\.\\.\\.");
	cFileUtil.CollapsePath(&sz);
	AssertString("", sz.Text());
	sz.Kill();

	sz.Init(".\\.\\.\\");
	cFileUtil.CollapsePath(&sz);
	AssertString("", sz.Text());
	sz.Kill();

	sz.Init("c:\\..");
	cFileUtil.CollapsePath(&sz);
	AssertString("c:", sz.Text());
	sz.Kill();

	sz.Init("c:\\..\\..");
	cFileUtil.CollapsePath(&sz);
	AssertString("c:", sz.Text());
	sz.Kill();

	sz.Init("\\..\\..");
	cFileUtil.CollapsePath(&sz);
	AssertString("", sz.Text());
	sz.Kill();
}
开发者ID:chrisjaquet,项目名称:Codaphela.Test,代码行数:55,代码来源:TestFileUtil.cpp

示例8: TestObjectsFlushNoClear

void TestObjectsFlushNoClear(void)
{
	CFileUtil	cFileUtil;
	BOOL		bResult;

	cFileUtil.RemoveDir("Output");
	cFileUtil.MakeDir("Output/Flush1");
	ObjectsInit("Output/Flush1");
	SetupObjectsForDehollowfication();

	AssertLongLongInt(0, gcObjects.NumDatabaseObjects());
	AssertLongLongInt(0, gcObjects.NumDatabaseNames());
	AssertLongLongInt(9, gcObjects.NumMemoryIndexes());
	AssertLongLongInt(6, gcObjects.NumMemoryNames());
	
	bResult = gcObjects.Flush(FALSE, FALSE);
	AssertTrue(bResult);

	AssertLongLongInt(9, gcObjects.NumDatabaseObjects());
	AssertLongLongInt(6, gcObjects.NumDatabaseNames());
	AssertLongLongInt(9, gcObjects.NumMemoryIndexes());
	AssertLongLongInt(6, gcObjects.NumMemoryNames());

	ObjectsKill();

	CArrayChars	aszFileNames;
	int				i;
	CChars*			psz;
	CChars			szOutput;
	CChars			szFileName;

	aszFileNames.Init();
	cFileUtil.FindAllFiles("Input/Dehollowfication", &aszFileNames, FALSE, FALSE);

	for (i = 0; i < aszFileNames.NumElements(); i++)
	{
		psz = aszFileNames.Get(i);
		
		szFileName.Init(psz->Text());
		cFileUtil.RemovePath(&szFileName);
		szOutput.Init();
		cFileUtil.CurrentDirectory(&szOutput);
		cFileUtil.AppendToPath(&szOutput, "Output/Flush1");
		cFileUtil.AppendToPath(&szOutput, szFileName.Text());

		AssertFile(psz->Text(), szOutput.Text());

		szOutput.Kill();
		szFileName.Kill();
	}

	aszFileNames.Kill();
}
开发者ID:andrewpaterson,项目名称:Codaphela.Test,代码行数:53,代码来源:TestObjects.cpp

示例9: TestRemoveExtension

void TestRemoveExtension(void)
{
	CChars		szFileName;
	CFileUtil	cFileUtil;

	szFileName.Init("/mnt/world/hello.txt");
	cFileUtil.RemoveExtension(&szFileName);
	AssertString("/mnt/world/hello", szFileName.Text());

	cFileUtil.RemoveExtension(&szFileName);
	AssertString("/mnt/world/hello", szFileName.Text());
	szFileName.Kill();
}
开发者ID:chrisjaquet,项目名称:Codaphela.Test,代码行数:13,代码来源:TestFileUtil.cpp

示例10: RecurseUnpack

BOOL CPackFiles::RecurseUnpack(CFileNodePackFileNode* pcNode, char* szDestination)
{
	CChars					szFileName;
	CFileNodePackFileNode*	pcChild;
	int						i;
	CPackFileNode*			pcFile;
	BOOL					bResult;
	CPackFile*				pcPackFile;
	CFileCopier				cCopier;
	CDiskFile				cDiskFile;
	CFileUtil				cFileUtil;

	if (pcNode->IsDirectory())
	{
		bResult = TRUE;
		for (i = 0; i < pcNode->Directory()->maNodeFiles.NumElements(); i++)
		{
			pcChild = (CFileNodePackFileNode*)pcNode->Directory()->maNodeFiles.Get(i);
			bResult &= RecurseUnpack(pcChild, szDestination);
		}
		return bResult;
	}
	else if (pcNode->IsFile())
	{
		szFileName.Init(szDestination);
		szFileName.Append('/');
		pcNode->GetFullName(&szFileName);
		szFileName.Replace('/', FILE_SEPARATOR[0]);

		pcFile = pcNode->File();
		pcPackFile = PackFile(this, pcFile);

		if (!pcPackFile)
		{
			szFileName.Kill();
			return FALSE;
		}

		cDiskFile.Init(szFileName.Text());

		cFileUtil.RemoveLastFromPath(&szFileName);
		cFileUtil.MakeDir(szFileName.Text());
		bResult = cCopier.Copy(pcPackFile, &cDiskFile);

		cDiskFile.Kill();

		szFileName.Kill();
		return bResult;
	}
	return FALSE;
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:51,代码来源:PackFiles.cpp

示例11: 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

示例12: ImportCels

BOOL CImageCelsSourceXML::ImportCels(CMarkupTag* pcCelsTag, char* szFileName)
{
	STagIterator				sIter;
	CSubImageXML				cSubImageXML;
	CMarkupTag*					pcCelTag;
	CArraySubImage				acSubImages;
	CSubImage*					pcSubImage;
	BOOL						bResult;
	CImageCelSourceSubImages	cSubImagesSource;
	CImageCelsSource			cCelsSource;
	CChars						szGroupName;
	CFileUtil					cFileUtil;
	Ptr<CImageCelGroup>			pcGroup;

	acSubImages.Init();
	pcCelTag = pcCelsTag->GetTag("Cel", &sIter);
	while (pcCelTag)
	{
		pcSubImage = acSubImages.Add();

		bResult = cSubImageXML.Import(pcCelTag, pcSubImage);
		if (!bResult)
		{
			acSubImages.Kill();
			return FALSE;
		}
		pcCelTag = pcCelsTag->GetNextTag(&sIter);
	}

	cSubImagesSource.Init(&acSubImages);

	szGroupName.Init(szFileName);
	cFileUtil.RemovePath(&szGroupName);

	cCelsSource.Init();
	cCelsSource.AddDiskFileSource(szFileName, szGroupName.Text(), &cSubImagesSource);
	cCelsSource.Load();

	mpcWorld->AddImages(cCelsSource.GetImages());

	pcGroup = ONMalloc(CImageCelGroup, szGroupName.Text());
	mpcWorld->AddGroup(pcGroup);
	pcGroup->AddCels(cCelsSource.GetImageCels());

	szGroupName.Kill();
	cSubImagesSource.Kill();
	cCelsSource.Kill();
	acSubImages.Kill();
	return TRUE;
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:50,代码来源:ImageCelsSourceXML.cpp

示例13: RemoveDir

BOOL CFileUtil::RemoveDir(const char*szPathName)
{
	WIN32_FIND_DATA		sFindData;
	CChars				szFindName;
	CChars				szTemp;
	HANDLE				hFindHandle;
	BOOL				bContinue;
	BOOL				bValid;
	CChars				szDirectory;
	BOOL				bDeleted;

	szDirectory.Init(szPathName);
	RemoveFileSeparator(&szDirectory);

	szFindName.Init(szPathName);
	AppendToPath(&szFindName, "*.*");

	hFindHandle = FindFirstFile(szFindName.Text(), &sFindData);
	bContinue = (hFindHandle != INVALID_HANDLE_VALUE);
	bDeleted = TRUE;
	while (bContinue)
	{
		bValid = TRUE;
		if (sFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
		{
			if (!((strcmp(sFindData.cFileName, ".") == 0) || (strcmp(sFindData.cFileName, "..") == 0)))
			{
				szTemp.Init(szDirectory);
				AppendToPath(&szTemp, sFindData.cFileName);
				RemoveDir(szTemp.Text());
				szTemp.Kill();
			}
		}
		else
		{
			szTemp.Init(szPathName);
			AppendToPath(&szTemp, sFindData.cFileName);
			bDeleted &= DeleteFile(szTemp.Text());
			szTemp.Kill();
		}
		bContinue = FindNextFile(hFindHandle, &sFindData);
	}
	FindClose(hFindHandle);
	RemoveDirectory(szDirectory.Text());

	szDirectory.Kill();
	szFindName.Kill();
	return bDeleted;
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:49,代码来源:FileUtil_Windows.cpp

示例14: TestReadExternalReference

void TestReadExternalReference(void)
{
	CXMLFile	cXMLFile;
	CChars		szDoc;
	int			iLine;
	char		szExpected[] = "<InputDevices>\n\
  This is text &lt; and doom stuff\n\
  <RootInSecond>\n\
    Hello\n\
  </RootInSecond>\n\
  Sweet &gt; other stuff\n\
  <ThirdsRoot>\n\
    World\n\
  </ThirdsRoot>\n\
</InputDevices>\n";
	CMarkupTag*	pcTag;
	CMarkupTag*	pcSecondTag;
	CMarkupTag*	pcThirdTag;
	CChars		szText;

	cXMLFile.Init();
	cXMLFile.Read("First.xml", ".");

	szDoc.Init(16);
	iLine = cXMLFile.mcMarkup.mpcDoc->ToString(&szDoc);
	AssertInt(10, iLine);
	AssertString(szExpected, szDoc.Text());
	szDoc.Kill();

	pcTag = cXMLFile.mcMarkup.mpcDoc->GetRootTag();
	pcSecondTag = pcTag->GetTag("RootInSecond");
	AssertNotNull(pcSecondTag);
	szText.Init();
	pcSecondTag->GetText(&szText);
	szText.StripWhiteSpace(TRUE);
	AssertString("Hello", szText.Text());
	szText.Kill();

	pcTag = cXMLFile.mcMarkup.mpcDoc->GetRootTag();
	pcThirdTag = pcTag->GetTag("ThirdsRoot");
	AssertNotNull(pcThirdTag);
	szText.Init();
	pcThirdTag->GetText(&szText);
	szText.StripWhiteSpace(TRUE);
	AssertString("World", szText.Text());
	szText.Kill();

	cXMLFile.Kill();
}
开发者ID:chrisjaquet,项目名称:Codaphela.Test,代码行数:49,代码来源:TestXMLFile.cpp

示例15: ReadNode

BOOL CPackFiles::ReadNode(void)
{
	CChars			sz;
	CFileNodePackFileNode*	pcNode;

	sz.Init();

	if (!sz.ReadString(&mcFile))
	{
		return FALSE;
	}

	pcNode = AddFile(sz.Text());
	sz.Kill();

	if (!((pcNode) && (pcNode->IsFile())))
	{
		return FALSE;
	}

	ReturnOnFalse(pcNode->File()->Load(&mcFile));

	miPosition = mcFile.GetFilePos();
	return TRUE;
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:25,代码来源:PackFiles.cpp


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