本文整理汇总了C++中TMsvEntry::Owner方法的典型用法代码示例。如果您正苦于以下问题:C++ TMsvEntry::Owner方法的具体用法?C++ TMsvEntry::Owner怎么用?C++ TMsvEntry::Owner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMsvEntry
的用法示例。
在下文中一共展示了TMsvEntry::Owner方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunL
void CMsvServerEntry::RunL()
//
//
//
{
__ASSERT_DEBUG(iEntryState != EMsvIdle, PanicServer(EMsvServerEntryIdle));
__ASSERT_DEBUG(iCopyMove, PanicServer(EMsvCopyMoveCompletionMissing));
if (iCopyMove->CompletedIds().Count() > 0)
{
switch (iEntryState)
{
case EMsvMoving:
{
iServer.NotifyChanged(EMsvEntriesMoved, iCopyMove->CompletedIds(), iCopyMove->TargetId(), iEntry.Id());
TMsvEntry* pEntry;
TInt err = KErrNone;
err = iServer.IndexAdapter().GetEntry(iEntry.Id(), pEntry);
if (err ==KErrNone)
iEntry.SetOwner(pEntry->Owner());
break;
}
case EMsvCopying:
{
const CMsvEntrySelection& newEntries = static_cast<CMsvCopyEntries*>(iCopyMove)->NewEntryIds();
iServer.NotifyChanged(EMsvEntriesCreated, newEntries, iCopyMove->TargetId());
if (iCompletedSelection)
{
iCompletedSelection->Reset();
TInt count = newEntries.Count();
while (count--)
iCompletedSelection->AppendL(newEntries[count]);
}
else if (iCompletedEntryId)
*iCompletedEntryId = newEntries[0];
break;
}
default:
break;
}
}
delete iCopyMove;
iCopyMove = NULL;
iEntryState = EMsvIdle;
User::RequestComplete(iObserverStatus, iStatus.Int());
}
示例2: DeleteEntry
EXPORT_C TInt CMsvServerEntry::DeleteEntry(TMsvId aId)
//
// Deletes the child of the current context recursively.
//
/** Deletes a child entry of the context. The delete works recursively through
all the descendants.
If a child or any descendant is locked by another client, then no entries
are deleted.
@param aId The ID of the entry to delete
@return KErrNone if successful, KErrAccessDenied if the entry or a descendant
was locked by another client, KErrInUse if the store or a file associated
with the entry is open, or KErrNotFound if the entry is not a child of the
context. */
{
__ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext4));
__ASSERT_DEBUG(aId!=iEntry.Id(), PanicServer(EMsvDeletingCurrentContext));
// only delete children
if (!IsAChild(aId))
return KErrNotFound;
// get the total selection of entries to be deleted
CMsvEntrySelection* movedEntries=NULL;
CMsvEntrySelection* deletedEntries=NULL;
TRAPD(error, DoDeleteEntryL(aId, deletedEntries, movedEntries));
// notify server of the deletions & moves
if (deletedEntries && movedEntries && (deletedEntries->Count() || movedEntries->Count()))
{
if (deletedEntries->Count())
iServer.NotifyChanged(EMsvEntriesDeleted, *deletedEntries, iEntry.Id());
if (movedEntries->Count())
iServer.NotifyChanged(EMsvEntriesMoved, *movedEntries, KMsvDeletedEntryFolderEntryId, iEntry.Id());
// need to remove owner flag if has no children
TMsvEntry* pEntry;
TInt err = KErrNone;
err = iServer.IndexAdapter().GetEntry(iEntry.Id(), pEntry);
if (err ==KErrNone)
iEntry.SetOwner(pEntry->Owner());
}
delete movedEntries;
delete deletedEntries;
return error;
}
示例3: DeleteEntries
EXPORT_C TInt CMsvServerEntry::DeleteEntries(CMsvEntrySelection& aSelection)
//
// Deletes the children of the current context in the selection recursively
// Returns the children that could not be fully deleted in the selection
//
/** Deletes a selection of child entries. The delete works recursively through
all the descendants.
If a child or any descendant is locked by another client, then no entries
are deleted.
@param aSelection The entries to delete. On return, contains the children
that could not be fully deleted
@return KErrNone if successful, KErrAccessDenied if the entry or a descendant
was locked by another client, KErrInUse if the store or a file associated
with the entry is open, or KErrNotFound if the entry is not a child of the
context. */
{
__ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext4));
CMsvEntrySelection* deleted = NULL;
CMsvEntrySelection* moved = NULL;
TRAPD(error, DoDeleteEntriesL(aSelection, deleted, moved));
if (moved && deleted)
{
// Notify server of the deletions & moves
if (deleted->Count())
iServer.NotifyChanged(EMsvEntriesDeleted, *deleted, iEntry.Id());
if (moved->Count())
iServer.NotifyChanged(EMsvEntriesMoved, *moved, KMsvDeletedEntryFolderEntryId, iEntry.Id());
// need to remove owner flag if has no children
TMsvEntry* pEntry;
TInt err = KErrNone;
err = iServer.IndexAdapter().GetEntry(iEntry.Id(), pEntry);
if (err ==KErrNone)
iEntry.SetOwner(pEntry->Owner());
}
delete moved;
delete deleted;
return error;
}
示例4: MoveEntryWithinService
EXPORT_C TInt CMsvServerEntry::MoveEntryWithinService(TMsvId aId, TMsvId aDestination)
//
// Moves the child of the current context
//
/** Moves a child of the context to under another entry. All descendants will be
moved as well. The destination must belong to the same service as the context.
If an error occurs, no changes are made.
For pre-Unicode releases see the synchronous overload of MoveEntry().
@param aId The ID of the entry to move
@param aDestination The ID of new parent
@return KErrNone if successful, KErrArgument if the destination is a child
of aId, KErrInUse if the store or a file associated with the entry is open,
KErrNotFound if the aId is not a child of the context KErrPathNotFound, if
the destination does not exist. */
{
__ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext10));
// only move children
if (!IsAChild(aId))
return KErrNotFound;
// check for moving into its current parent
if (aDestination==iEntry.Id())
return KErrNone;
TRAPD(error, DoMoveEntryL(aId, aDestination));
// notify server of the move
if (error==KErrNone)
{
iServer.NotifyChanged(EMsvEntriesMoved, aId, aDestination, iEntry.Id());
// need to remove owner flag if has no children
TMsvEntry* pEntry;
TInt err = KErrNone;
err = iServer.IndexAdapter().GetEntry(iEntry.Id(), pEntry);
if (err==KErrNone)
iEntry.SetOwner(pEntry->Owner());
}
return error;
}
示例5: MoveEntriesWithinService
EXPORT_C TInt CMsvServerEntry::MoveEntriesWithinService(CMsvEntrySelection& aSelection, TMsvId aDestination)
//
//
//
/** Moves a child of the context to under another entry. All descendants will be
moved as well. The destination must belong to the same service as the context.
@param aSelection The entries to move. On return, contains the children that
could not be fully moved.
@param aDestination The ID of new parent
@return KErrNone if successful, KErrArgument if the destination is a child
of aSelection entry, KErrInUse if the store or a file associated with an entry
is open, KErrNotFound if an aSelection entry is not a child of the context
the, or KErrPathNotFound if the destination does not exist. */
{
__ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext10));
CMsvEntrySelection* moved = NULL;
TRAPD(error, DoMoveEntriesL(aSelection, aDestination, moved));
if (moved && moved->Count())
{
iServer.NotifyChanged(EMsvEntriesMoved, *moved, aDestination, iEntry.Id());
// need to remove owner flag if has no children
TMsvEntry* pEntry;
TInt err = KErrNone;
err = iServer.IndexAdapter().GetEntry(iEntry.Id(), pEntry);
if (err==KErrNone)
iEntry.SetOwner(pEntry->Owner());
}
delete moved;
return error;
}