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


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

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


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

示例1: deleteItem

int WebOsCalendarSyncSource::deleteItem(SyncItem &item)
{
	int ret = STC_COMMAND_FAILED;
	LOG.info("deleteItem called with %s data. And Type %s.",item.getKey(),item.getDataType());

	LOG.info("Calling deleteEvent.");
	std::vector<WString> result = BlockingServiceCall("deleteEvent",item.getKey());
	if(result.empty())
	{
		LOG.error("delete event %s did not work.",item.getKey());
		ret = STC_COMMAND_FAILED;
	}
	else
	{
		LOG.error("delete 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 deleting item: %", item.getKey());
	}

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

示例2: addItem

int LOSyncSource::addItem(SyncItem& item) {

    WCHAR luid[128];
    wsprintf(luid, TEXT("%s-luid"), item.getKey());
    item.setKey(luid);
    return 200;
}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:7,代码来源:LOSyncSource.cpp

示例3: d

END_TEST

/**
* Removed the STATUS from the winevent parser
*/
BEGIN_TEST(WinEventNoSTATUS)
{
    int ret = 0;
    SyncItem* item = NULL;
    WCHAR* internalKey = NULL;
    wstring propValue; 

    WindowsSyncSource* ss = createAppointmentWindowsSyncSource();   
    WIN_ASSERT_NOT_NULL(ss, TEXT("The syncSource is null."));

    StringBuffer VCal;
    VCal.append("BEGIN:VCALENDAR\r\n");
    VCal.append("VERSION:1.0\r\n");
    VCal.append("BEGIN:VEVENT\r\n");
    VCal.append("X-FUNAMBOL-FOLDER:DEFAULT_FOLDER\r\n");
    VCal.append("X-FUNAMBOL-ALLDAY:1\r\n");
    VCal.append("DTSTART:20110407\r\n");
    VCal.append("DTEND:20110408\r\n");
    VCal.append("X-MICROSOFT-CDO-BUSYSTATUS:FREE\r\n");
    VCal.append("CATEGORIES:\r\n");
    VCal.append("DESCRIPTION:\r\n");
    VCal.append("LOCATION:Roma\r\n");
    VCal.append("PRIORITY:1\r\n");
    VCal.append("STATUS:NEED ACTION\r\n");
    VCal.append("X-MICROSOFT-CDO-REPLYTIME:\r\n");
    VCal.append("SUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Da test\r\n");
    VCal.append("CLASS:PUBLIC\r\n");
    VCal.append("AALARM:20110406T060000Z;;0;\r\n");
    VCal.append("RRULE:\r\n");
    VCal.append("X-FUNAMBOL-BILLINGINFO:\r\n");
    VCal.append("X-FUNAMBOL-COMPANIES:\r\n");
    VCal.append("X-FUNAMBOL-MILEAGE:\r\n");
    VCal.append("X-FUNAMBOL-NOAGING:0 \r\n");
    VCal.append("END:VEVENT\r\n");
    VCal.append("END:VCALENDAR");

    item = new SyncItem(TEXT("GUID"));
    item->setData(VCal.c_str(), VCal.length());
    
    WCHAR* tt = toWideChar(VCal.c_str());

    WinEvent d(tt);
    printf("%S", d.toString().c_str());        

    // insert test item
    ret = ss->addItem(*item);
    WIN_ASSERT_EQUAL(ret, 201, TEXT("Adding item is not correct"));    
    internalKey = (WCHAR*)item->getKey();        
    
    delete item;
    delete ss;
}
开发者ID:funambol-mirror,项目名称:funambol-windows-client,代码行数:57,代码来源:dataTransformerTest.cpp

示例4: deleteItem

int AbstractSyncSource::deleteItem(SyncItem& item)
{
    QUniqueId id(QString((char *)item.getKey()));
    //qDebug() << "AbstractSyncSource::deleteItem()" << toString(item) << "Id:" << id.toString();
    if (m_model->removeRecord(id))
        return 200; //ok, the SyncML command completed successfully
    else
        return 211; //failed, the recipient encountered an error
}
开发者ID:saschpe,项目名称:qtopia-pimsync,代码行数:9,代码来源:abstractsyncsource.cpp

示例5: deleteItem

int TestSyncSource::deleteItem(SyncItem& item) {
    char* val = toMultibyte( item.getKey() );
    LOG.info("deleted item: %s", val);
    if(val){
        delete [] val;
        val = 0;
    }
    return 200;
}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:9,代码来源:TestSyncSource.cpp

示例6: addItem

int CacheSyncSource::addItem(SyncItem& item) {
    int ret = insertItem(item);
    switch (ret) {        
        case 200:
        case 201:
        case 418: {
            LOG.info("[%s] Successful add of item with key %s - code %d", getName(), item.getKey(), ret);
            KeyValuePair k;
            getKeyAndSignature(item, k);
            insertInCache(k);
        }
        break;
        default:
            LOG.error("[%s] Failed add of item with key %s - code %d", getName(), item.getKey(), ret);
        break;
    }
    return ret;
}
开发者ID:ruphy,项目名称:kfunambol,代码行数:18,代码来源:CacheSyncSource.cpp

示例7: 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
}
开发者ID:saschpe,项目名称:qtopia-pimsync,代码行数:10,代码来源:abstractsyncsource.cpp

示例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;
}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:19,代码来源:TestSyncSource.cpp

示例9: getKeyAndSignature

void CacheSyncSource::getKeyAndSignature(SyncItem& item, KeyValuePair& kvp) {
    
    char* t = toMultibyte(item.getKey());
    StringBuffer s(t);
    StringBuffer sign = getItemSignature(s);
    kvp.setKey(t);
    kvp.setValue(sign);
    delete [] t;
    
}
开发者ID:ruphy,项目名称:kfunambol,代码行数:10,代码来源:CacheSyncSource.cpp

示例10: deleteItem

int CacheSyncSource::deleteItem(SyncItem& item) {
    int ret = removeItem(item);
    switch (ret) {        
        case 200:
        case 201:
        case 418: {
            LOG.info("[%s] Successful delete of item with key %s - code %d", getName(), item.getKey(), ret);  
            char* t = toMultibyte(item.getKey());
            KeyValuePair k (t, "");
            removeFromCache(k);
            delete [] t;
        }
        break;
        default:
            LOG.error("[%s] Failed delete of item with key %s - code %d", getName(), item.getKey(), ret);
        break;
    }
    
    return ret;
} 
开发者ID:ruphy,项目名称:kfunambol,代码行数:20,代码来源:CacheSyncSource.cpp

示例11: 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;
}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:16,代码来源:TestSyncSource.cpp

示例12: 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;
}
开发者ID:saschpe,项目名称:qtopia-pimsync,代码行数:19,代码来源:abstractsyncsource.cpp

示例13: testSetItemStatus

    void testSetItemStatus(){
        StringBuffer inFile = getTestFileFullPath(TEST_INPUT_DIR, TEST_FILE_NAME1);
        SyncItem* si = fmss->fakeFillSyncItem(&inFile, true);

        const WCHAR* wKey = si->getKey();
        const char* key = toMultibyte(wKey);
        fmss->setItemStatus(wKey, 200, "Add");
        ArrayList luidToSend = fmss->getLUIDArray();

        bool luidPresent = false;
        for (int i = 0; i < luidToSend.size(); i++){
            if( strcmp( ((StringBuffer*)luidToSend.get(i))->c_str(), key) == 0 ){
                luidPresent = true;
            }
        }
        CPPUNIT_ASSERT(luidPresent);

        int ret = fmss->endSync();
        CPPUNIT_ASSERT( ret == 0 );
    
        StringBuffer propval = fmss->fakeReadCachePropertyValue(inFile.c_str());
        CPPUNIT_ASSERT( !propval.empty() );
    }
开发者ID:fieldwind,项目名称:syncsdk,代码行数:23,代码来源:MediaSyncSourceTest.cpp

示例14: createContactWindowsSyncSource


//.........这里部分代码省略.........
    VCard.append(" PolpdjeEUk98UVh+GdfLFYZzg9j60V0xrRt76szz6ixFKXKmc349zNq17HnG+7kB+gY0+Cwj\r\n");
    VCard.append(" t9EWNAP3h5OKKK4cVBLAysuv6nYm44KFjMnsEGtIGwQVCn3Fbt1pccKrCrHZ5fGaKKzx0I+x\r\n");
    VCard.append(" oytqmjbEzkvZ2ZmeGv8ARL+SEcrursrqySWLfwDiiiu+OlZ27E4ttVE0P0K9dJTbv8wHQ1t3\r\n");
    VCard.append(" enw3MeWUc+tFFdrSaPNxPuVLx0OcvdHht2LxYUj0ooorwsVJqpodMJykk2z/2Q==\r\n");
    VCard.append("\r\n");        
    VCard.append("X-ANNIVERSARY:20100902\r\n");
    VCard.append("X-FUNAMBOL-BILLINGINFO:\r\n");
    VCard.append("TEL;X-FUNAMBOL-CALLBACK:5555555555\r\n");
    VCard.append("X-FUNAMBOL-CHILDREN:\r\n");
    VCard.append("X-FUNAMBOL-COMPANIES:\r\n");
    VCard.append("X-FUNAMBOL-FOLDER:DEFAULT_FOLDER\r\n");
    VCard.append("X-FUNAMBOL-HOBBIES:\r\n");
    VCard.append("EMAIL;INTERNET;HOME;X-FUNAMBOL-INSTANTMESSENGER:IMaddress\r\n");
    VCard.append("X-FUNAMBOL-INITIALS:P.M.P.\r\n");
    VCard.append("X-FUNAMBOL-LANGUAGES:\r\n");
    VCard.append("X-MANAGER:managerName\r\n");
    VCard.append("X-FUNAMBOL-MILEAGE:\r\n");
    VCard.append("X-FUNAMBOL-ORGANIZATIONALID:\r\n");
    VCard.append("TEL;X-FUNAMBOL-RADIO:1717171717\r\n");
    VCard.append("X-SPOUSE:spuse\r\n");
    VCard.append("X-FUNAMBOL-SUBJECT:Paolino Middle Paperino suffix\r\n");
    VCard.append("TEL;X-FUNAMBOL-TELEX:1181818181818\r\n");
    VCard.append("X-FUNAMBOL-YOMICOMPANYNAME:\r\n");
    VCard.append("X-FUNAMBOL-YOMIFIRSTNAME:\r\n");
    VCard.append("X-FUNAMBOL-YOMILASTNAME:\r\n");
    VCard.append("END:VCARD");

    item = new SyncItem(TEXT("GUID"));
    item->setData(VCard.c_str(), VCard.length());
    
    // insert test item
    ret = ss->addItem(*item);
    WIN_ASSERT_EQUAL(ret, 201, TEXT("Adding item is not correct"));    
    internalKey = (WCHAR*)item->getKey();
    
    //
    // remove work and car tel number
    //
    VCard.reset();
    VCard.append("BEGIN:VCARD\r\n");
    VCard.append("VERSION:2.1\r\n");
    VCard.append("N:Paperino;Paolino;Middle;Mr.;suffix\r\n");    
    VCard.append("PHOTO;ENCODING=b;TYPE=JPEG:\r\n");
    VCard.append(" /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQY\r\n");
    VCard.append(" GBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYa\r\n");
    VCard.append(" KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAAR\r\n");
    VCard.append(" CAA2AEgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA\r\n");
    VCard.append(" AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK\r\n");
    VCard.append(" FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG\r\n");
    VCard.append(" h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl\r\n");
    VCard.append(" 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA\r\n");
    VCard.append(" AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk\r\n");
    VCard.append(" NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE\r\n");
    VCard.append(" hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk\r\n");
    VCard.append(" 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCfxl4r1qy8S69Aut61bW9vqMysHmlCRxu7\r\n");
    VCard.append(" BSrKeFHbsBjpivOm8d+KAQreJtdSVE8uRW1CbnGSJFGemB+tbXxIef8A4THxCDaXAjF/dees\r\n");
    VCard.append(" t1tjuYhMxG0Z4xXnN9dwNAkTTJIAodFlRi6jkbAfoc14+HUuaTu3r/X9Py6n0s3FQjdJaLdW\r\n");
    VCard.append(" v99vw8007pnZaf418TSW0lxceK9eUjaVRb6U9eSuN3pjmki8beKhOF/4SnWAQcfNqExAx1zg\r\n");
    VCard.append(" +tcL9qMSxqc+WoABxt8zBwMep55zVyzlclwxJl+6Y2kC/MTnp3rrcZK7uYQ5FJJr+v8AhtvT\r\n");
    VCard.append(" RbHoFn4z8Qmf7NL4p1tVbBybyRmLHsDngZ7VqP4p8SxHYfEOsEoNzn7bIck9FHzVx8Yit7SL\r\n");
    VCard.append(" M8Ksko3nAZ93XgDqK1IyWRbi4iaNC2Y1I+82eGPevLrTle6bsfTYKEGuWpFX7WX9fgj0f4Z+\r\n");
    VCard.append(" JvEUt4H1PWLtrQnGLudmLk9hk9q91tpJpFBM0hyP7xr5d8MTeVqcVzK4Yq3yjzAQzemK+gdD\r\n");
    VCard.append(" 1rdax+YArY5Gc0YfFqM3GbPJzvDLn5qaXyRuam1wIG8ueVTjqrkUVXudQR4D0NFTipxlO6kz\r\n");
    VCard.append(" yKMZRjZo+WvippZi8c+JmW1VojcTytLdTEj5nJJQdsE4xXBXxaaCZ/tE5DwxmIvags4UjO0j\r\n");
    VCard.append(" oB616f43uGfxX4kgtrW5ucalcfajcSfucea2wY9B1Fcrb6LfraahdWs4lkgk+zs6yARpCwyy\r\n");
    VCard.append(" qOua0jX9m37R6p/13td/gep7HmpLk6r9H2tffzfmcdNZt5rSIXO9TLBJcDHnJ0IUdM5rRsra\r\n");
开发者ID:funambol-mirror,项目名称:funambol-windows-client,代码行数:67,代码来源:dataTransformerTest.cpp


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