Monotone-Parent: 8da45ab6716906aaf63acf12643978541601c34c
Monotone-Revision: a12dbbc9418dd5823b93f9c1246417a6c1fa121a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-22T19:31:12 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
e9425a9281
commit
053d871c03
|
@ -1,5 +1,9 @@
|
||||||
2011-11-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2011-11-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* OpenChange/MAPIStoreTypes.m (NSObjectFromValuePointer):
|
||||||
|
simplified method by using set_SPropValue_proptag and
|
||||||
|
NSObjectFromSPropValue.
|
||||||
|
|
||||||
* OpenChange/NSObject+MAPIStore.m (-getValue:forTag:inMemCtx:):
|
* OpenChange/NSObject+MAPIStore.m (-getValue:forTag:inMemCtx:):
|
||||||
renamed from "getMAPIValue:...".
|
renamed from "getMAPIValue:...".
|
||||||
(-asArrayOfUnicodeStringsInMemCtx:) renamed from "asArrayOfUnicodeStringsInCtx".
|
(-asArrayOfUnicodeStringsInMemCtx:) renamed from "asArrayOfUnicodeStringsInCtx".
|
||||||
|
|
|
@ -40,7 +40,7 @@ double *MAPIDoubleValue (void *memCtx, double value);
|
||||||
|
|
||||||
id NSObjectFromSPropValue (const struct SPropValue *);
|
id NSObjectFromSPropValue (const struct SPropValue *);
|
||||||
id NSObjectFromMAPISPropValue (const struct mapi_SPropValue *);
|
id NSObjectFromMAPISPropValue (const struct mapi_SPropValue *);
|
||||||
id NSObjectFromValuePointer (enum MAPITAGS, void *);
|
id NSObjectFromValuePointer (enum MAPITAGS, const void *);
|
||||||
|
|
||||||
static inline NSNumber *
|
static inline NSNumber *
|
||||||
MAPIPropertyKey (enum MAPITAGS propTag)
|
MAPIPropertyKey (enum MAPITAGS propTag)
|
||||||
|
|
|
@ -253,65 +253,15 @@ NSObjectFromSPropValue (const struct SPropValue *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
id
|
id
|
||||||
NSObjectFromValuePointer (enum MAPITAGS propTag, void *data)
|
NSObjectFromValuePointer (enum MAPITAGS propTag, const void *data)
|
||||||
{
|
{
|
||||||
|
struct SPropValue sPropValue;
|
||||||
id result;
|
id result;
|
||||||
|
|
||||||
switch (propTag & 0xffff)
|
if (set_SPropValue_proptag(&sPropValue, propTag, data))
|
||||||
{
|
result = NSObjectFromSPropValue (&sPropValue);
|
||||||
case PT_NULL:
|
else
|
||||||
result = [NSNull null];
|
result = nil;
|
||||||
break;
|
|
||||||
case PT_SHORT:
|
|
||||||
result = [NSNumber numberWithShort: *(int16_t *) data];
|
|
||||||
break;
|
|
||||||
case PT_LONG:
|
|
||||||
result = [NSNumber numberWithLong: *(int32_t *) data];
|
|
||||||
break;
|
|
||||||
case PT_I8:
|
|
||||||
result = [NSNumber numberWithUnsignedLongLong: *(uint64_t *) data];
|
|
||||||
break;
|
|
||||||
case PT_BOOLEAN:
|
|
||||||
result = [NSNumber numberWithBool: ((*(uint8_t *) data) ? YES : NO)];
|
|
||||||
break;
|
|
||||||
case PT_DOUBLE:
|
|
||||||
result = [NSNumber numberWithDouble: *(double *) data];
|
|
||||||
break;
|
|
||||||
case PT_UNICODE:
|
|
||||||
result = [NSString stringWithUTF8String: data];
|
|
||||||
break;
|
|
||||||
case PT_STRING8:
|
|
||||||
result = [NSString stringWithUTF8String: data];
|
|
||||||
break;
|
|
||||||
case PT_SYSTIME:
|
|
||||||
result = [NSCalendarDate dateFromFileTime: data];
|
|
||||||
break;
|
|
||||||
case PT_BINARY:
|
|
||||||
case PT_SVREID:
|
|
||||||
// lpProps->value.bin = *((const struct Binary_r *)data);
|
|
||||||
|
|
||||||
result = [NSData dataWithBinary: (const struct Binary_r *) data];
|
|
||||||
break;
|
|
||||||
// case PT_CLSID:
|
|
||||||
// result = [NSData dataWithFlatUID: value->value.lpguid];
|
|
||||||
// break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
// #define PT_UNSPECIFIED 0x0
|
|
||||||
// #define PT_I2 0x2
|
|
||||||
// #define PT_CURRENCY 0x6
|
|
||||||
// #define PT_APPTIME 0x7
|
|
||||||
// #define PT_ERROR 0xa
|
|
||||||
// #define PT_OBJECT 0xd
|
|
||||||
// #define PT_I8 0x14
|
|
||||||
// #define PT_SVREID 0xFB
|
|
||||||
// #define PT_SRESTRICT 0xFD
|
|
||||||
// #define PT_ACTIONS 0xFE
|
|
||||||
result = [NSNull null];
|
|
||||||
abort();
|
|
||||||
NSLog (@"%s: object type not handled: %d (0x%.8x)", __PRETTY_FUNCTION__,
|
|
||||||
propTag, propTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue