aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc
diff options
context:
space:
mode:
authorGravatar DINH Viet Hoa <hoa@sprw.me>2013-01-27 11:28:05 -0800
committerGravatar DINH Viet Hoa <hoa@sprw.me>2013-01-27 11:28:05 -0800
commitd528e515c1645dedc6aec3c43ab378cc2228cf3c (patch)
tree9cab2b7d455b805f5c3615f5d2d06219ee3f865a /src/objc
parent80ebb639fbd575864fb9039048c9e90f3a9b4f13 (diff)
added -[NSData mco_mcData] to return a mailcore::Data
Diffstat (limited to 'src/objc')
-rw-r--r--src/objc/utils/NSData+MCO.h4
-rw-r--r--src/objc/utils/NSData+MCO.mm5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/objc/utils/NSData+MCO.h b/src/objc/utils/NSData+MCO.h
index 9ed227bb..ea19e03d 100644
--- a/src/objc/utils/NSData+MCO.h
+++ b/src/objc/utils/NSData+MCO.h
@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
-#include <mailcore/mailcore.h>
+#include <mailcore/MCData.h>
#ifdef __OBJC__
@@ -16,6 +16,8 @@
#ifdef __cplusplus
+ (NSData *) mco_dataWithMCData:(mailcore::Data *)cppData;
+
+- (mailcore::Data *) mco_mcData;
#endif
@end
diff --git a/src/objc/utils/NSData+MCO.mm b/src/objc/utils/NSData+MCO.mm
index abec3077..70838280 100644
--- a/src/objc/utils/NSData+MCO.mm
+++ b/src/objc/utils/NSData+MCO.mm
@@ -18,4 +18,9 @@
return [NSData dataWithBytes:cppData->bytes() length:cppData->length()];
}
+- (mailcore::Data *) mco_mcData
+{
+ return mailcore::Data::dataWithBytes((const char *) [self bytes], (unsigned int) [self length]);
+}
+
@end