本文整理汇总了C++中SyncItem::getDataSize方法的典型用法代码示例。如果您正苦于以下问题:C++ SyncItem::getDataSize方法的具体用法?C++ SyncItem::getDataSize怎么用?C++ SyncItem::getDataSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyncItem
的用法示例。
在下文中一共展示了SyncItem::getDataSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}