本文整理汇总了C++中HippoGridInfo::setVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ HippoGridInfo::setVersion方法的具体用法?C++ HippoGridInfo::setVersion怎么用?C++ HippoGridInfo::setVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HippoGridInfo
的用法示例。
在下文中一共展示了HippoGridInfo::setVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseData
void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
{
LLSD::array_const_iterator it, end = gridInfo.endArray();
for (it = gridInfo.beginArray(); it != end; ++it) {
LLSD gridMap = *it;
if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
std::string gridnick = gridMap["gridnick"];
HippoGridInfo *grid;
GridIterator it = mGridInfo.find(gridnick);
bool newGrid = (it == mGridInfo.end());
if (gridMap.has("version")) {
int version = gridMap["version"];
if (version == -1) {
// delete grid
if (!newGrid) mGridInfo.erase(it);
continue;
} else if (mergeIfNewer && !newGrid && (version <= it->second->getVersion())) {
// don't update if version is not newer
continue;
}
}
if (newGrid) {
// create new grid info
grid = new HippoGridInfo(gridnick);
} else {
// update existing grid info
grid = it->second;
}
grid->setLoginUri(gridMap["loginuri"]);
if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
if (gridMap.has("lastlogin_fname")) grid->setLastFName(gridMap["lastlogin_fname"]);
if (gridMap.has("lastlogin_lname")) grid->setLastLName(gridMap["lastlogin_lname"]);
if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
//if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
if (gridMap.has("version")) grid->setVersion(gridMap["version"]);
if (newGrid) addGrid(grid);
}
}
}