本文整理汇总了C++中SyncItem::getData方法的典型用法代码示例。如果您正苦于以下问题:C++ SyncItem::getData方法的具体用法?C++ SyncItem::getData怎么用?C++ SyncItem::getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyncItem
的用法示例。
在下文中一共展示了SyncItem::getData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateItem
int WebOsCalendarSyncSource::updateItem(SyncItem &item)
{
int ret = STC_COMMAND_FAILED;
LOG.info("updateItem called with %s data. And Type %s.",item.getKey(),item.getDataType());
LOG.info("Calling updateEvent %s.",item.getKey());
std::vector<WString> result = BlockingServiceCall("updateEvent",(WCHAR*)item.getData(),item.getKey());
if(result.empty())
{
LOG.error("update event %s did not work.",item.getData());
ret = STC_COMMAND_FAILED;
}
else
{
LOG.debug("update event was successful, received: %s.",result[0].c_str());
ret = STC_OK;
}
if (isErrorCode(ret))
{
report->setLastErrorCode(ERR_ITEM_ERROR);
report->setLastErrorMsg(ERRMSG_ITEM_ERROR);
report->setState(SOURCE_ERROR);
LOG.debug("Error updating item: %s", item.getKey());
}
return ret;
}
示例2: updateItem
int AbstractSyncSource::updateItem(SyncItem& item)
{
QByteArray data((char *)item.getData());
QUniqueId id(QString((char *)item.getKey()));
//qDebug() << "AbstractSyncSource::updateItem()" << toString(item) << "Id:" << id.toString();
if (m_model->updateRecord(id, data, m_type))
return 200; //ok, the SyncML command completed successfully
else
return 500; //failed, the recipient encountered an error
}
示例3: addItem
int AbstractSyncSource::addItem(SyncItem& item)
{
QByteArray data((char *)item.getData());
QUniqueId id = m_model->addRecord(data, QPimSource(), m_type);
item.setKey(id.toString().toAscii().data());
m_model->updateRecord(id, data, m_type);
//qDebug() << "AbstractSyncSource::addItem() " << toString(item) << "Id:" << id.toString();
if (!id.isNull())
return 201; //ok, the requested item was added
else
return 500; //failed, the recipient encountered an error
}
示例4: testFillSyncItem
void testFillSyncItem(){
StringBuffer inFile = getTestFileFullPath(TEST_INPUT_DIR, TEST_FILE_NAME1);
SyncItem* si = fmss->fakeFillSyncItem(&inFile, true);
StringBuffer* data = new StringBuffer((char*)si->getData());
CPPUNIT_ASSERT(si != NULL);
CPPUNIT_ASSERT(data != NULL);
CPPUNIT_ASSERT(data->find("body") == StringBuffer::npos);
CPPUNIT_ASSERT(data->find("size") != StringBuffer::npos);
}
示例5: updateItem
int TestSyncSource::updateItem(SyncItem& item) {
char* val = toMultibyte( item.getKey() );
LOG.info("updated item: %s", val);
if(val){
delete [] val;
val = 0;
}
char *data = new char [item.getDataSize()];
memcpy(data, item.getData(), item.getDataSize());
data[item.getDataSize()] = 0;
LOG.info("Data: %s", data);
delete [] data;
return 200;
}
示例6: testAllItems
//test te getFirstItem. We pass all the values into the properties ArrayList
//and we get the first one
void testAllItems() {
ArrayList properties;
ConfigSyncSource source(TEXT("config"), APPLICATIONURI, s);
StringBuffer emailaddress("./Email/Address");
properties.add(emailaddress);
source.setConfigProperties(properties);
Enumeration* val = source.getAllItemList();
SyncItem* value = source.getFirstItem();
StringBuffer valuedata((const char*)value->getData(),value->getDataSize());
CPPUNIT_ASSERT(valuedata == VALUE);
delete val;
delete value;
}
示例7: toString
QString AbstractSyncSource::toString(SyncItem& item)
{
QByteArray data((char *)item.getData());
QString ret("Key: ");
ret += item.getKey();
ret += " Mod.Time: ";
ret += QString::number(item.getModificationTime());
ret += " Encoding: ";
ret += item.getDataEncoding();
ret += " Size: ";
ret += QString::number(item.getDataSize());
ret += " Type: ";
ret += item.getDataType();
ret += " State: ";
ret += QString::number(item.getState());
ret += " Data:\n";
ret += data;
return ret;
}
示例8: addItem
int TestSyncSource::addItem(SyncItem& item) {
char* val = toMultibyte( item.getKey() );
LOG.info("added item: %s", val);
if(val){
delete [] val;
val = 0;
}
char *data = new char [item.getDataSize()];
memcpy(data, item.getData(), item.getDataSize());
data[item.getDataSize()] = 0;
LOG.info("Data: %s", data);
delete [] data;
WCHAR *luid = new WCHAR[wcslen(item.getKey())+10];
wsprintf(luid, TEXT("%s-luid"), item.getKey());
item.setKey(luid);
return 200;
}
示例9: updateOutlookItem
END_TEST
WinContact* updateOutlookItem(WindowsSyncSource* ss, SyncItem* item) {
int ret = ss->updateItem(*item);
WIN_ASSERT_EQUAL(ret, 200, TEXT("Update item is not correct"));
wstring keyModified = item->getKey();
SyncItem* itemTmp = ss->getItemFromId(keyModified.c_str());
WIN_ASSERT_NOT_NULL(item, TEXT("The item retrieved from the backend is null."));
WCHAR* wcon = toWideChar((const char*)itemTmp->getData());
wstring wcontact(wcon);
delete [] wcon;
WinContact* winC = new WinContact(wcontact);
return winC;
}