Monotone-Parent: f097a1cc5cb254dca09ba971f32de7339f109a97
Monotone-Revision: e356443889853160f98a31849aede88bc4bac6bd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-12-30T14:49:54 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
4e60090b52
commit
a18e6f3dbf
|
@ -1,5 +1,13 @@
|
|||
2010-12-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreTypes.m (MAPIDoubleValue): new wrapper
|
||||
methods for generating data of "double" type.
|
||||
(NSObjectFromMAPISPropValue, NSObjectFromSPropValue): now handle
|
||||
the PT_CLSID mapi type.
|
||||
(
|
||||
(MAPIStoreDumpMessageProperties): enhanced logging of property
|
||||
keys.
|
||||
|
||||
* OpenChange/NSData+MAPIStore.m (+dataWithFlatUID)
|
||||
(-asFlatUIDInMemCtx:, +dataWithGUID:, asGUIDInMemCtx:): new
|
||||
methods for handling the two GUID mapistore types.
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
uint8_t *MAPIBoolValue (void *memCtx, BOOL value);
|
||||
uint32_t *MAPILongValue (void *memCtx, uint32_t value);
|
||||
uint64_t *MAPILongLongValue (void *memCtx, uint64_t value);
|
||||
double *MAPIDoubleValue (void *memCtx, double value);
|
||||
|
||||
id NSObjectFromSPropValue (const struct SPropValue *);
|
||||
id NSObjectFromMAPISPropValue (const struct mapi_SPropValue *);
|
||||
|
|
|
@ -71,6 +71,17 @@ MAPILongLongValue (void *memCtx, uint64_t value)
|
|||
return llongValue;
|
||||
}
|
||||
|
||||
double *
|
||||
MAPIDoubleValue (void *memCtx, double value)
|
||||
{
|
||||
double *doubleValue;
|
||||
|
||||
doubleValue = talloc_zero (memCtx, double);
|
||||
*doubleValue = value;
|
||||
|
||||
return doubleValue;
|
||||
}
|
||||
|
||||
id
|
||||
NSObjectFromMAPISPropValue (const struct mapi_SPropValue *value)
|
||||
{
|
||||
|
@ -105,10 +116,12 @@ NSObjectFromMAPISPropValue (const struct mapi_SPropValue *value)
|
|||
result = [NSCalendarDate dateFromFileTime: &(value->value.ft)];
|
||||
break;
|
||||
case PT_BINARY:
|
||||
// lpProps->value.bin = *((const struct Binary_r *)data);
|
||||
|
||||
result = [NSData dataWithShortBinary: &value->value.bin];
|
||||
break;
|
||||
case PT_CLSID:
|
||||
result = [NSData dataWithGUID: &value->value.lpguid];
|
||||
break;
|
||||
|
||||
default:
|
||||
// #define PT_UNSPECIFIED 0x0
|
||||
// #define PT_I2 0x2
|
||||
|
@ -117,7 +130,6 @@ NSObjectFromMAPISPropValue (const struct mapi_SPropValue *value)
|
|||
// #define PT_ERROR 0xa
|
||||
// #define PT_OBJECT 0xd
|
||||
// #define PT_I8 0x14
|
||||
// #define PT_CLSID 0x48
|
||||
// #define PT_SVREID 0xFB
|
||||
// #define PT_SRESTRICT 0xFD
|
||||
// #define PT_ACTIONS 0xFE
|
||||
|
@ -169,6 +181,10 @@ NSObjectFromSPropValue (const struct SPropValue *value)
|
|||
= [NSData dataWithBinary:
|
||||
(const struct Binary_r *) &(value->value.bin)];
|
||||
break;
|
||||
case PT_CLSID:
|
||||
result = [NSData dataWithFlatUID: value->value.lpguid];
|
||||
break;
|
||||
|
||||
default:
|
||||
// #define PT_UNSPECIFIED 0x0
|
||||
// #define PT_I2 0x2
|
||||
|
@ -177,7 +193,6 @@ NSObjectFromSPropValue (const struct SPropValue *value)
|
|||
// #define PT_ERROR 0xa
|
||||
// #define PT_OBJECT 0xd
|
||||
// #define PT_I8 0x14
|
||||
// #define PT_CLSID 0x48
|
||||
// #define PT_SVREID 0xFB
|
||||
// #define PT_SRESTRICT 0xFD
|
||||
// #define PT_ACTIONS 0xFE
|
||||
|
@ -224,7 +239,6 @@ MAPIStoreDumpMessageProperties (NSDictionary *properties)
|
|||
NSNumber *key;
|
||||
NSArray *allKeys;
|
||||
NSUInteger keyAsInt, count, max;
|
||||
const char *name;
|
||||
id value;
|
||||
|
||||
allKeys = [properties allKeys];
|
||||
|
@ -243,12 +257,9 @@ MAPIStoreDumpMessageProperties (NSDictionary *properties)
|
|||
{
|
||||
keyAsInt = [key intValue];
|
||||
value = [properties objectForKey: key];
|
||||
name = get_proptag_name (keyAsInt);
|
||||
if (!name)
|
||||
name = "unknown";
|
||||
NSLog (@" 0x%.8x (%s): %@ (%@)",
|
||||
keyAsInt, name,
|
||||
value, NSStringFromClass ([value class]));
|
||||
NSLog (@" 0x%.4x: %@ (%@)",
|
||||
keyAsInt, value,
|
||||
NSStringFromClass ([value class]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue