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


C++ FileReader::BreakUntil方法代码示例

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


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

示例1: if

void IGFManager :: LoadConfig(void)
{
	char buffer[256];
	Platform::GenerateFilePath(buffer, "IGForum", "IGFSession.txt");
	FileReader lfr;
	if(lfr.OpenText(buffer) != Err_OK)
	{
		g_Logs.data->error("IGFManager::LoadConfig failed to open file.");
		return;
	}
	lfr.CommentStyle = Comment_Semi;
	while(lfr.FileOpen() == true)
	{
		lfr.ReadLine();
		int r = lfr.BreakUntil("=", '=');
		if(r > 0)
		{
			lfr.BlockToStringC(0, 0);
			if(strcmp(lfr.SecBuffer, "NextCategoryID") == 0)
				mNextCategoryID = lfr.BlockToIntC(1);
			else if(strcmp(lfr.SecBuffer, "NextThreadID") == 0)
				mNextThreadID = lfr.BlockToIntC(1);
			else if(strcmp(lfr.SecBuffer, "NextPostID") == 0)
				mNextPostID = lfr.BlockToIntC(1);
			else if(strcmp(lfr.SecBuffer, "PlatformLaunchMinute") == 0)
				mPlatformLaunchMinute = lfr.BlockToULongC(1);
			else
				g_Logs.data->warn("IGFManager::LoadConfig unknown identifier [%v] in file [%v] on line [%v]", lfr.SecBuffer, buffer, lfr.LineNumber);
		}
	}
	lfr.CloseCurrent();
}
开发者ID:kgrubb,项目名称:iceee,代码行数:32,代码来源:IGForum.cpp

示例2: LoadSocialData

void FriendListManager :: LoadSocialData(void)
{
	if(socialDataFile.size() == 0)
	{
		g_Log.AddMessageFormat("Social Cache filename not set.");
		return;
	}
	FileReader lfr;
	if(lfr.OpenText(socialDataFile.c_str()) != Err_OK)
	{
		g_Log.AddMessageFormat("Error opening Social Cache file for reading: %s", socialDataFile.c_str());
		return;
	}
	lfr.CommentStyle = Comment_Semi;
	SocialWindowEntry newItem;
	while(lfr.FileOpen() == true)
	{
		lfr.ReadLine();
		int r = lfr.BreakUntil(",|", '|');
		if(r >= 6)
		{
			newItem.creatureDefID = lfr.BlockToIntC(0);
			newItem.name = lfr.BlockToStringC(1, 0);
			newItem.level = lfr.BlockToIntC(2);
			newItem.profession = lfr.BlockToIntC(3);
			newItem.online = lfr.BlockToBoolC(4);
			newItem.shard = lfr.BlockToStringC(5, 0);

			//HACK: since the friend list is only loaded when the server is launched,
			//it's safe to assume that everyone is offline.  This should auto fix any
			//players that are stuck offline.  If I had been thinking when I designed
			//this, the online flag wouldn't be saved at all.
			//TODO: remove onine status from save files
			newItem.online = false;

			//Get the status last in case it contains any unusual characters.
			if(r >= 7)
				newItem.status = lfr.BlockToStringC(6, 0);
			else
				newItem.status.clear();
			UpdateSocialEntry(newItem);
		}
	}
	lfr.CloseCurrent();
}
开发者ID:Wuffie12,项目名称:iceee,代码行数:45,代码来源:FriendStatus.cpp


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