本文整理汇总了C++中FileReader::MultiBreak方法的典型用法代码示例。如果您正苦于以下问题:C++ FileReader::MultiBreak方法的具体用法?C++ FileReader::MultiBreak怎么用?C++ FileReader::MultiBreak使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileReader
的用法示例。
在下文中一共展示了FileReader::MultiBreak方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadNetworkData
void FriendListManager :: LoadNetworkData(void)
{
if(networkDataFile.size() == 0)
{
g_Log.AddMessageFormat("Network Cache filename not set.");
return;
}
FileReader lfr;
if(lfr.OpenText(networkDataFile.c_str()) != Err_OK)
{
g_Log.AddMessageFormat("Error opening Network Cache file for reading: %s", networkDataFile.c_str());
return;
}
lfr.CommentStyle = Comment_Semi;
while(lfr.FileOpen() == true)
{
lfr.ReadLine();
int r = lfr.MultiBreak("=,");
if(r >= 2)
{
int sourceDefID = lfr.BlockToIntC(0);
std::vector<int> &ref = networkData[sourceDefID];
for(int i = 1; i < r; i++)
ref.push_back(lfr.BlockToIntC(i));
}
}
lfr.CloseCurrent();
}
示例2: if
void IGFThreadPage :: LoadFile(const char *filename)
{
FileReader lfr;
if(lfr.OpenText(filename) != Err_OK)
{
g_Logs.data->error("IGFThreadPage::LoadFile failed to open file.");
return;
}
lfr.CommentStyle = Comment_Semi;
IGFThread entry;
while(lfr.FileOpen() == true)
{
lfr.ReadLine();
int r = lfr.BreakUntil("=", '=');
if(r > 0)
{
lfr.BlockToStringC(0, 0);
if(strcmp(lfr.SecBuffer, "[ENTRY]") == 0)
{
if(entry.mID != 0)
InsertEntry(entry, false);
entry.Clear();
}
else if(strcmp(lfr.SecBuffer, "ID") == 0)
entry.mID = lfr.BlockToIntC(1);
else if(strcmp(lfr.SecBuffer, "Title") == 0)
entry.mTitle = lfr.BlockToStringC(1, 0);
else if(strcmp(lfr.SecBuffer, "CreationAccount") == 0)
entry.mCreationAccount = lfr.BlockToIntC(1);
else if(strcmp(lfr.SecBuffer, "CreationTime") == 0)
entry.mCreationTime = lfr.BlockToStringC(1, 0);
else if(strcmp(lfr.SecBuffer, "CreatorName") == 0)
entry.mCreatorName = lfr.BlockToStringC(1, 0);
else if(strcmp(lfr.SecBuffer, "ParentCategory") == 0)
entry.mParentCategory = lfr.BlockToIntC(1);
else if(strcmp(lfr.SecBuffer, "Locked") == 0)
entry.mLocked = lfr.BlockToBoolC(1);
else if(strcmp(lfr.SecBuffer, "Stickied") == 0)
entry.mStickied = lfr.BlockToBoolC(1);
else if(strcmp(lfr.SecBuffer, "Flags") == 0)
entry.mFlags.setraw(lfr.BlockToIntC(1));
else if(strcmp(lfr.SecBuffer, "LastUpdateTime") == 0)
entry.mLastUpdateTime = lfr.BlockToULongC(1);
else if(strcmp(lfr.SecBuffer, "PostList") == 0)
{
r = lfr.MultiBreak("=,");
for(int i = 1; i < r; i++)
entry.mPostList.push_back(lfr.BlockToIntC(i));
}
else
g_Logs.data->warn("IGFThreadPage::LoadFile unknown identifier [%v] in file [%v] on line [%v]", lfr.SecBuffer, filename, lfr.LineNumber);
}
}
if(entry.mID != 0)
InsertEntry(entry, false);
lfr.CloseCurrent();
}