本文整理汇总了C++中Alert::getItems方法的典型用法代码示例。如果您正苦于以下问题:C++ Alert::getItems方法的具体用法?C++ Alert::getItems怎么用?C++ Alert::getItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alert
的用法示例。
在下文中一共展示了Alert::getItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processServerAlert
/*
* Processes the initialization response. Returns 0 in case of success, an
* error code in case of error.
*
* @param msg the response from the server
*/
int SyncMLProcessor::processServerAlert(SyncSource& source, SyncML* syncml) {
int ret = -1;
int iterator = 0;
AbstractCommand* a = NULL;
bool found = false;
ret = 0;
do {
a = getCommand(syncml->getSyncBody(), ALERT, iterator);
if (a == NULL) {
// This happens with the Synthesis server's reply:
// instead of sending SyncBody/Alert we get SyncBody/Put
// with device infos and a SyncBody/Get requesting our own
// device infos. Ignoring the request is not correct, but
// allows synchronization to proceed and complete eventually
// without any further errors. For that to work we must not
// set lastErrorCode here, as it will be checked at the end of
// the sync.
//
// lastErrorCode = ERR_REPRESENTATION;
// sprintf(lastErrorMsg, "SyncBody/Alert not found!");
goto finally;
}
Alert* alert = (Alert*)a;
Item* item = NULL;
ArrayList* itemList = alert->getItems();
for (int i = 0; i < itemList->size(); i++) {
item = (Item*)getArrayElement(itemList, i);
const char *locURI = ((Target*)item->getTarget())->getLocURI();
if (strcmp( locURI, _wcc(source.getName()) ) == 0) {
if ( !alert->getData() ) {
setError(ERR_REPRESENTATION, "SyncBody/Alert/Data not found!");
goto finally;
}
source.setSyncMode((SyncMode)alert->getData());
ret = 0;
found = true;
break;
}
}
iterator++;
if (found)
break;
} while(a);
finally:
return ret;
}