From ab9fbf320e594c16b0e015a11b2ccea2c5743bea Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 31 May 2011 05:06:26 +0000 Subject: [PATCH] Monotone-Parent: fafa72b8e42848069a3affa9d8e8895134ebc136 Monotone-Revision: 34a150bec80d8bcacb0dffe7e4fbe342dc0b2d3d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-05-31T05:06:26 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ OpenChange/NSValue+MAPIStore.h | 1 + OpenChange/NSValue+MAPIStore.m | 12 +++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8d96d50ea..2382a5c26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-05-31 Wolfgang Sourdeau + * OpenChange/NSValue+MAPIStore.m (-asI8InMemCtx:): new method that + extracts an uint64_t from an NSNumber. + * OpenChange/MAPIStoreFallbackContext.[hm]: new class module for the "fallback" context, used by the OpenChange core to create contexts that are not specifically handled. diff --git a/OpenChange/NSValue+MAPIStore.h b/OpenChange/NSValue+MAPIStore.h index 1e2261557..6352b9a4c 100644 --- a/OpenChange/NSValue+MAPIStore.h +++ b/OpenChange/NSValue+MAPIStore.h @@ -30,6 +30,7 @@ - (uint8_t *) asBooleanInMemCtx: (void *) memCtx; - (uint16_t *) asShortInMemCtx: (void *) memCtx; - (uint32_t *) asLongInMemCtx: (void *) memCtx; +- (uint64_t *) asI8InMemCtx: (void *) memCtx; - (double *) asDoubleInMemCtx: (void *) memCtx; @end diff --git a/OpenChange/NSValue+MAPIStore.m b/OpenChange/NSValue+MAPIStore.m index 4800f7e91..83d583e33 100644 --- a/OpenChange/NSValue+MAPIStore.m +++ b/OpenChange/NSValue+MAPIStore.m @@ -31,7 +31,7 @@ uint8_t *value; value = talloc (memCtx, uint8_t); - *value = [self boolValue]; + *value = ([self boolValue] ? 1 : 0); return value; } @@ -56,6 +56,16 @@ return value; } +- (uint64_t *) asI8InMemCtx: (void *) memCtx +{ + uint64_t *value; + + value = talloc (memCtx, uint64_t); + *value = [self unsignedLongLongValue]; + + return value; +} + - (double *) asDoubleInMemCtx: (void *) memCtx { double *value;