本文整理汇总了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();
}
示例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();
}