本文整理汇总了C++中FileReader::BlockToBoolC方法的典型用法代码示例。如果您正苦于以下问题:C++ FileReader::BlockToBoolC方法的具体用法?C++ FileReader::BlockToBoolC怎么用?C++ FileReader::BlockToBoolC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileReader
的用法示例。
在下文中一共展示了FileReader::BlockToBoolC方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例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();
}
示例3: LoadConfig
//.........这里部分代码省略.........
#endif
else if (strcmp(NameBlock, "RebroadcastDelay") == 0) {
g_RebroadcastDelay = lfr.BlockToULongC(1);
} else if (strcmp(NameBlock, "SceneryAutosaveTime") == 0) {
g_SceneryAutosaveTime = lfr.BlockToULongC(1);
} else if (strcmp(NameBlock, "ForceUpdateTime") == 0) {
g_ForceUpdateTime = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "ItemBindingTypeOverride") == 0) {
g_ItemBindingTypeOverride = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "ItemArmorTypeOverride") == 0) {
g_ItemArmorTypeOverride = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "ItemWeaponTypeOverride") == 0) {
g_ItemWeaponTypeOverride = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "MOTD_Name") == 0) {
g_MOTD_Name = lfr.BlockToStringC(1, 0);
} else if (strcmp(NameBlock, "MOTD_Channel") == 0) {
g_MOTD_Channel = lfr.BlockToStringC(1, 0);
} else if (strcmp(NameBlock, "RemoteAuthenticationPassword") == 0) {
g_Config.RemoteAuthenticationPassword = lfr.BlockToStringC(1,
0);
} else if (strcmp(NameBlock, "ProperSceneryList") == 0) {
g_Config.ProperSceneryList = lfr.BlockToIntC(1);
} else if (strcmp(NameBlock, "BuybackLimit") == 0) {
g_Config.BuybackLimit = lfr.BlockToIntC(1);
} else if (strcmp(NameBlock, "Upgrade") == 0)
g_Config.Upgrade = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "HeartbeatIntervalMS") == 0)
g_Config.HeartbeatIntervalMS = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "HeartbeatAbortCount") == 0)
g_Config.HeartbeatAbortCount = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "WarpMovementBlockTime") == 0)
g_Config.WarpMovementBlockTime = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "IdleCheckVerification") == 0)
g_Config.IdleCheckVerification = lfr.BlockToBoolC(1);
else if (strcmp(NameBlock, "IdleCheckFrequency") == 0)
g_Config.IdleCheckFrequency = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "IdleCheckDistance") == 0)
g_Config.IdleCheckDistance = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "IdleCheckCast") == 0)
g_Config.IdleCheckCast = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "IdleCheckCastInterval") == 0)
g_Config.IdleCheckCastInterval = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "IdleCheckDistanceTolerance") == 0)
g_Config.IdleCheckDistanceTolerance = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "EnvironmentCycle") == 0)
g_Config.EnvironmentCycle = lfr.BlockToString(1);
else if (strcmp(NameBlock, "SendLobbyHeartbeat") == 0)
g_Config.SendLobbyHeartbeat = lfr.BlockToBoolC(1);
else if (strcmp(NameBlock, "CapExperienceLevel") == 0)
g_Config.CapExperienceLevel = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "CapExperienceAmount") == 0)
g_Config.CapExperienceAmount = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "CustomAbilityMechanics") == 0)
g_Config.CustomAbilityMechanics = lfr.BlockToBoolC(1);
else if (strcmp(NameBlock, "DebugPingServer") == 0)
g_Config.DebugPingServer = lfr.BlockToBoolC(1);
else if (strcmp(NameBlock, "DebugPingClient") == 0)
g_Config.DebugPingClient = lfr.BlockToBoolC(1);
else if (strcmp(NameBlock, "DebugPingFrequency") == 0)
g_Config.DebugPingFrequency = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "DebugPingClientPollInterval") == 0)
g_Config.DebugPingClientPollInterval = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "DebugPingServerLogThreshold") == 0)
g_Config.DebugPingServerLogThreshold = lfr.BlockToIntC(1);
else if (strcmp(NameBlock, "HTTPDeleteConnectedTime") == 0)
g_Config.HTTPDeleteConnectedTime = lfr.BlockToIntC(1);