diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-07-31 23:35:08 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2013-07-31 23:35:08 -0700 |
commit | 85a26f97fefac157bb3d310f444f7c86a8b07204 (patch) | |
tree | e8fd7d161b72b4b425b9f1dfaee80c0205602903 /src/objc/utils | |
parent | a722d215582e295d9e8fe5fb876d61a7a93cf494 (diff) |
Serialization of IMAP data. Implemented base64.
Diffstat (limited to 'src/objc/utils')
-rw-r--r-- | src/objc/utils/NSObject+MCO.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/objc/utils/NSObject+MCO.h b/src/objc/utils/NSObject+MCO.h index 31818ce3..4d8d4274 100644 --- a/src/objc/utils/NSObject+MCO.h +++ b/src/objc/utils/NSObject+MCO.h @@ -78,6 +78,20 @@ MCO_NATIVE_INSTANCE->setter((mcType) getter); \ MCO_NATIVE_INSTANCE->setter([getter timeIntervalSince1970]); \ } +#define MCO_SYNTHESIZE_NSCODING \ +- (id) initWithCoder:(NSCoder *)coder \ +{ \ + mailcore::HashMap * serializable = MCO_FROM_OBJC(mailcore::HashMap, [coder decodeObjectForKey:@"info"]); \ + self = MCO_TO_OBJC(mailcore::Object::objectWithSerializable(serializable)); \ + [self retain]; \ + return self; \ +} \ +\ +- (void) encodeWithCoder:(NSCoder *)coder \ +{ \ + [coder encodeObject:MCO_TO_OBJC(MCO_FROM_OBJC(nativeType, self)->serializable()) forKey:@"info"]; \ +} + @interface NSObject (MCO) #ifdef __cplusplus |