本文整理汇总了C++中CContactItemField::Storage方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactItemField::Storage方法的具体用法?C++ CContactItemField::Storage怎么用?C++ CContactItemField::Storage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContactItemField
的用法示例。
在下文中一共展示了CContactItemField::Storage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RestoreBinaryL
/**
Utility method used to read binary fields from blob and fill item field set,Provides a mechanism to restore a
contact item field set from binary blob field within contact database.
Blob informations are stored based on contact item field. At restore, a reference to a contact item field set
is provided. For every contact item field in the item field set, a text restore is made.
@param aFieldSet Reference to CContactItemFieldSet. Item field set that has to be filled with informations from blob
@param aHeaderStore Stream store containing the header informations
@param aId Root id for the header stream store
@param aValuesStore Read stream used to read text fields from binary blob
@param aViewDef View definition indicating which fields have to be read from blob
@param aTemplate Template indicating if current field set should be filled based on a template
*/
void TCntPersistenceUtility::RestoreBinaryL(CContactItemFieldSet& aFieldSet, CStreamStore& aHeaderStore, TStreamId aId, CStreamStore* aBlobStore, const CContactItemViewDef& aViewDef, const CContactItem* aTemplate)
{
const TBool KIncludeFields = aViewDef.Use() == CContactItemViewDef::EIncludeFields;
if (KIncludeFields && aViewDef.Count() == 0)
{
// If view definition does not contain any field we don't do anything (don't read from
// blob). We simply return from method without doing anything.
// This is not an error condition
return;
}
RStoreReadStream stream;
stream.OpenLC(aHeaderStore,aId);
TCardinality fieldCount;
stream>>fieldCount;
TStreamId nestedId;
for (TInt ii = 0; ii < fieldCount; ++ii)
{
// Restore binary value for every CContactItemField in provided CContactItemFieldSet.
CContactItemField* field = CContactItemField::NewLC();
if(aTemplate)
{
nestedId = field->RestoreFieldTypesL(stream, &(aTemplate->CardFields()));
}
else
{
nestedId = field->RestoreFieldTypesL(stream, NULL);
}
ASSERT(field->StorageType() != KStorageTypeText);
TBool fieldDefined = ETrue;
if(!aViewDef.MatchesAll())
{
fieldDefined = (aViewDef.Find(field->ContentType()) != KErrNotFound);
}
if ((!((fieldDefined && KIncludeFields) || (!fieldDefined && !KIncludeFields))) ||
(field->IsHidden() && aViewDef.Mode() == CContactItemViewDef::EMaskHiddenFields))
{
CleanupStack::PopAndDestroy(field);
}
else
{
RStoreReadStream readStream;
readStream.OpenLC(*aBlobStore, nestedId);
field->Storage()->RestoreL(*aBlobStore, readStream);
CleanupStack::PopAndDestroy(&readStream);
aFieldSet.AddL(*field);
CleanupStack::Pop(field);
}
}
CleanupStack::PopAndDestroy(&stream);
}