getNewFMIDs: new wrapper method around openchangedb_get_new_folderIDs

pull/5/head
Wolfgang Sourdeau 2012-10-12 23:25:51 -04:00
parent 641eb8013b
commit ea98a35fad
2 changed files with 28 additions and 0 deletions

View File

@ -103,6 +103,7 @@
- (uint64_t) idForObjectWithKey: (NSString *) key
inFolderURL: (NSString *) folderURL;
- (NSArray *) getNewFMIDs: (uint64_t) max;
- (uint64_t) getNewChangeNumber;
- (NSArray *) getNewChangeNumbers: (uint64_t) max;

View File

@ -586,6 +586,33 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
return newChangeNumbers;
}
- (NSArray *) getNewFMIDs: (uint64_t) max
{
TALLOC_CTX *memCtx;
NSMutableArray *newFMIDs;
uint64_t count;
struct UI8Array_r *numbers;
NSString *newNumber;
memCtx = talloc_zero(NULL, TALLOC_CTX);
newFMIDs = [NSMutableArray arrayWithCapacity: max];
if (openchangedb_get_new_folderIDs (connInfo->oc_ctx,
memCtx, max, &numbers)
!= MAPI_E_SUCCESS || numbers->cValues != max)
abort ();
for (count = 0; count < max; count++)
{
newNumber
= [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
[newFMIDs addObject: newNumber];
}
talloc_free (memCtx);
return newFMIDs;
}
/* subclasses */
+ (NSString *) MAPIModuleName