当前位置: 首页>>代码示例>>C++>>正文


C++ SyncItem::setDataType方法代码示例

本文整理汇总了C++中SyncItem::setDataType方法的典型用法代码示例。如果您正苦于以下问题:C++ SyncItem::setDataType方法的具体用法?C++ SyncItem::setDataType怎么用?C++ SyncItem::setDataType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SyncItem的用法示例。


在下文中一共展示了SyncItem::setDataType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getNextDeletedItem

SyncItem* WebOsCalendarSyncSource::getNextDeletedItem()
{
	LOG.info("=========== GET NEXT DELETED ITEM CALLED ==================");
	if(!mGetChangesCalled)
	{
		getChanges();
	}

	std::vector<WString> result = BlockingServiceCall("getDeletedEvent",TEXT(""));
	if(result.empty())
	{
		LOG.error("GetDeleted failed.");
	}
	else
	{
		if(result.front() != "finished")
		{
			SyncItem* item = new SyncItem();
			item->setDataType(TEXT("text/calendar"));
			//item->setData(e.second.c_str(),e.second.length()); no data for deleted items..
			item->setKey(result.front().c_str());
			LOG.debug("Added %s as deleted.",result.front().c_str());
			return item;
		}
	}

	return NULL;
}
开发者ID:Garfonso,项目名称:webOsSyncML-2.0,代码行数:28,代码来源:WebOsCalendarSyncSource.cpp

示例2: getNextItem

SyncItem* WebOsCalendarSyncSource::getNextItem()
{
	LOG.info("========== GET NEXT ITEM CALLED ===========");
	if(mEvents.empty())
	{
		//no items anymore, need to get more. If that doesn't work, there are no more items.
		getMoreItems();
		if(mEvents.empty())
		{
			LOG.info("======= NO MORE ELEMENTS ==========");
			return NULL;
		}
	}

	if(!mEvents.empty())
	{
		//take first event and convert into item of correct type.
		std::pair<WString,WString>& e = mEvents.front();
		SyncItem* item = new SyncItem();
		item->setDataType(TEXT("text/calendar"));
		item->setData(e.second.c_str(),e.second.length());
		item->setKey(e.first.c_str());
		LOG.debug("Received %s from JS with key %s.",e.second.c_str(),e.first.c_str());
		mEvents.pop_front();
		return item;
	}
	else
		return NULL;
}
开发者ID:Garfonso,项目名称:webOsSyncML-2.0,代码行数:29,代码来源:WebOsCalendarSyncSource.cpp

示例3: getNextUpdatedItem

SyncItem* WebOsCalendarSyncSource::getNextUpdatedItem()
{
	LOG.info("=========== GET NEXT UPDATED ITEM CALLED ==================");
	if(!mGetChangesCalled)
	{
		getChanges();
	}

	if(!mEvents.empty())
	{
		//take first event and convert into item of correct type.
		std::pair<WString,WString>& e = mEvents.front();
		SyncItem* item = new SyncItem();
		item->setDataType(TEXT("text/calendar"));
		item->setData(e.second.c_str(),e.second.length());
		item->setKey(e.first.c_str());
		LOG.debug("Received %s from JS.",e.second.c_str());
		mEvents.pop_front();
		return item;
	}
	else
		return NULL;


	return NULL;
}
开发者ID:Garfonso,项目名称:webOsSyncML-2.0,代码行数:26,代码来源:WebOsCalendarSyncSource.cpp

示例4: SyncItem

SyncItem *AbstractSyncSource::createSyncItem(const QUniqueId &id, bool wantData, SyncState state) const
{
    //qDebug() << "AbstractSyncSource::createSyncItem(" << id.toString() << "," << wantData << "," << state << ")";
    QByteArray record = m_model->record(id, m_type);
    SyncItem *item = new SyncItem();
    QString key = id.toString();
    item->setKey(key.toAscii().data());
    item->setModificationTime(m_lastSync.toTime_t());
    item->setState(state);
    if (wantData) {
        item->setData(record.data(), record.size() - 1); // have to omit '\0'
        item->setDataType(getConfig().getType());
    }
    //qDebug() << "AbstractSyncSource::createSyncItem()" << toString(*item);
    return item;
}
开发者ID:saschpe,项目名称:qtopia-pimsync,代码行数:16,代码来源:abstractsyncsource.cpp


注:本文中的SyncItem::setDataType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。