本文整理汇总了C++中HippoGridInfo::setPlatform方法的典型用法代码示例。如果您正苦于以下问题:C++ HippoGridInfo::setPlatform方法的具体用法?C++ HippoGridInfo::setPlatform怎么用?C++ HippoGridInfo::setPlatform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HippoGridInfo
的用法示例。
在下文中一共展示了HippoGridInfo::setPlatform方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onXmlCharacterData
//static
void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int len)
{
HippoGridInfo* self = (HippoGridInfo*)userData;
switch (self->mXmlState)
{
case XML_GRIDNICK:
{
if (self->mGridNick == "")
{
self->mGridNick.assign(s, len);
self->mGridNick = sanitizeGridNick(self->mGridNick);
}
break;
}
case XML_PLATFORM:
{
std::string platform(s, len);
self->setPlatform(platform);
break;
}
case XML_LOGINURI:
{
self->setLoginUri(std::string(s, len));
break;
}
case XML_HELPERURI:
{
self->setHelperUri(std::string(s, len));
break;
}
case XML_SEARCH:
{
self->mSearchUrl.assign(s, len);
//sanitizeQueryUrl(mSearchUrl);
break;
}
case XML_GRIDNAME:
{
if (self->mGridName == "")
{
self->mGridName.assign(s, len);
}
break;
}
case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break;
case XML_WEBSITE: self->mWebSite.assign(s, len); break;
case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
case XML_MESSAGE: self->mGridMessage.assign(s, len); break;
case XML_VOID: break;
}
}
示例2: parseData
void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
{
if (mergeIfNewer) {
LLSD::array_const_iterator it, end = gridInfo.endArray();
for (it = gridInfo.beginArray(); it != end; ++it) {
LLSD gridMap = *it;
if (gridMap.has("default_grids_version")) {
int version = gridMap["default_grids_version"];
if (version <= mDefaultGridsVersion) return;
else break;
}
}
if (it == end) {
llwarns << "Grid data has no version number." << llendl;
return;
}
}
llinfos << "Loading grid data." << llendl;
LLSD::array_const_iterator it, end = gridInfo.endArray();
for (it = gridInfo.beginArray(); it != end; ++it) {
LLSD gridMap = *it;
if (gridMap.has("default_grids_version")) {
mDefaultGridsVersion = gridMap["default_grids_version"];
} else 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 (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("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("firstname")) grid->setFirstName(gridMap["firstname"]);
if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
if (newGrid) addGrid(grid);
}
}
}
示例3: 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);
}
}
}
示例4: saveCurGrid
// returns false, if adding new grid failed
bool HippoPanelGridsImpl::saveCurGrid()
{
HippoGridInfo *gridInfo = 0;
gridInfo = gHippoGridManager->getGrid(mCurGrid);
//gridInfo->retrieveGridInfo();
refresh();
std::string gridname = childGetValue("gridname");
if (gridname == "<required>") gridname = "";
std::string loginuri = childGetValue("loginuri");
if (loginuri == "<required>") loginuri = "";
if (gridname.empty() && !loginuri.empty())
this->retrieveGridInfo();
if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
// check nickname
std::string gridname = childGetValue("gridname");
childSetValue("gridname", (gridname != "")? gridname: "<required>");
if (gridname == "") {
LLNotificationsUtil::add("GridsNoNick");
return false;
}
if (gHippoGridManager->getGrid(gridname)) {
LLSD args;
args["NAME"] = gridname;
LLNotificationsUtil::add("GridExists", args);
return false;
}
// check login URI
if (loginuri == "") {
LLSD args;
args["NAME"] = gridname;
LLNotificationsUtil::add("GridsNoLoginUri", args);
return false;
}
mState = NORMAL;
mCurGrid = gridname;
gridInfo = new HippoGridInfo(gridname);
gHippoGridManager->addGrid(gridInfo);
gridInfo->retrieveGridInfo();
}
if (!gridInfo) {
llwarns << "Grid not found, ignoring changes." << llendl;
return true;
}
gridInfo->setPlatform(childGetValue("platform"));
gridInfo->setGridName(childGetValue("gridname"));
gridInfo->setLoginUri(childGetValue("loginuri"));
gridInfo->setLoginPage(childGetValue("loginpage"));
gridInfo->setHelperUri(childGetValue("helperuri"));
gridInfo->setWebSite(childGetValue("website"));
gridInfo->setSupportUrl(childGetValue("support"));
gridInfo->setRegisterUrl(childGetValue("register"));
gridInfo->setPasswordUrl(childGetValue("password"));
gridInfo->setSearchUrl(childGetValue("search"));
gridInfo->setRenderCompat(childGetValue("render_compat"));
refresh();
return true;
}
示例5: saveCurGrid
// returns false, if adding new grid failed
bool HippoPanelGridsImpl::saveCurGrid()
{
HippoGridInfo *gridInfo = 0;
gridInfo = gHippoGridManager->getGrid(mCurGrid);
//gridInfo->getGridInfo();
refresh();
std::string gridname = childGetValue("gridname");
if (gridname == "<required>") gridname = "";
std::string loginuri = childGetValue("loginuri");
if (loginuri == "<required>") loginuri = "";
if (gridname.empty() && !loginuri.empty())
this->retrieveGridInfo();
if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
// check nickname
std::string gridname = childGetValue("gridname");
childSetValue("gridname", (gridname != "")? gridname: "<required>");
if (gridname == "") {
LLNotificationsUtil::add("GridsNoNick");
return false;
}
if (gHippoGridManager->getGrid(gridname)) {
LLSD args;
args["NAME"] = gridname;
LLNotificationsUtil::add("GridExists", args);
return false;
}
// check login URI
if (loginuri == "") {
LLSD args;
args["NAME"] = gridname;
LLNotificationsUtil::add("GridsNoLoginUri", args);
return false;
}
mState = NORMAL;
mCurGrid = gridname;
gridInfo = new HippoGridInfo(gridname);
gHippoGridManager->addGrid(gridInfo);
try
{
gridInfo->getGridInfo();
}
catch (AIAlert::ErrorCode const& error)
{
if (error.getCode() == HTTP_NOT_FOUND || error.getCode() == HTTP_METHOD_NOT_ALLOWED)
{
// Ignore this error; it might be a user entered entry for a grid that has no get_grid_info support.
llwarns << AIAlert::text(error) << llendl;
}
else if (error.getCode() == HTTP_OK)
{
// XML parse error.
AIAlert::add("GridInfoError", error);
}
else
{
// Append GridInfoErrorInstruction to error message.
AIAlert::add("GridInfoError", AIAlert::Error(AIAlert::Prefix(), AIAlert::not_modal, error, "GridInfoErrorInstruction"));
}
}
}
if (!gridInfo) {
llwarns << "Grid not found, ignoring changes." << llendl;
return true;
}
gridInfo->setPlatform(childGetValue("platform"));
gridInfo->setGridName(childGetValue("gridname"));
gridInfo->setLoginUri(childGetValue("loginuri"));
gridInfo->setLoginPage(childGetValue("loginpage"));
gridInfo->setHelperUri(childGetValue("helperuri"));
gridInfo->setWebSite(childGetValue("website"));
gridInfo->setSupportUrl(childGetValue("support"));
gridInfo->setRegisterUrl(childGetValue("register"));
gridInfo->setPasswordUrl(childGetValue("password"));
gridInfo->setSearchUrl(childGetValue("search"));
gridInfo->setRenderCompat(childGetValue("render_compat"));
refresh();
return true;
}
示例6: parseData
void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
{
if (mergeIfNewer)
{
LLSD::array_const_iterator it, end = gridInfo.endArray();
for (it = gridInfo.beginArray(); it != end; ++it)
{
LLSD gridMap = *it;
if (gridMap.has("default_grids_version"))
{
int version = gridMap["default_grids_version"];
if (version <= mDefaultGridsVersion) return;
else break;
}
}
if (it == end)
{
llwarns << "Grid data has no version number." << llendl;
return;
}
}
llinfos << "Loading grid data." << llendl;
LLSD::array_const_iterator it, end = gridInfo.endArray();
for (it = gridInfo.beginArray(); it != end; ++it)
{
LLSD gridMap = *it;
if (gridMap.has("default_grids_version"))
{
mDefaultGridsVersion = gridMap["default_grids_version"];
}
else if ((gridMap.has("gridnick") || gridMap.has("gridname")) && gridMap.has("loginuri"))
{
std::string gridnick = gridMap["gridnick"];
std::string gridname = gridMap["gridname"];
HippoGridInfo* grid;
GridIterator it = mGridInfo.end();
for (it = mGridInfo.begin(); it != mGridInfo.end(); ++it)
{
if(!gridnick.empty() && (it->second->getGridNick() == gridnick))
{
break;
}
if(gridnick.empty() && !gridname.empty() && (it->first == gridname))
{
break;
}
}
bool newGrid = (it == mGridInfo.end());
if (newGrid || !it->second)
{
if(gridname.empty())
{
gridname = gridnick;
}
// create new grid info
grid = new HippoGridInfo(gridname);
}
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("gridnick")) grid->setGridNick(gridMap["gridnick"]);
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("inventory_links")) grid->setSupportsInvLinks(gridMap["inventory_links"]);
if (gridMap.has("auto_update")) grid->mAutoUpdate = gridMap["auto_update"];
if (gridMap.has("locked")) grid->mLocked = gridMap["locked"];
if (newGrid) addGrid(grid);
}
}
}