diff options
author | Ken Grigsby <grigsby@thursby.com> | 2013-04-19 19:10:49 -0500 |
---|---|---|
committer | Ken Grigsby <grigsby@thursby.com> | 2013-04-19 19:10:49 -0500 |
commit | 8123121157b7fd2ec27ee1b9f7f6a23357955b4e (patch) | |
tree | ad1a647e5aa1141cdcec5c7c8f9383aa01bb061e /src/objc/rfc822 | |
parent | 6397bdb1cf09503680b8b0861ea237fa8199a637 (diff) |
added methods to decode data as strings
Diffstat (limited to 'src/objc/rfc822')
-rw-r--r-- | src/objc/rfc822/MCOAttachment.h | 3 | ||||
-rw-r--r-- | src/objc/rfc822/MCOAttachment.mm | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/objc/rfc822/MCOAttachment.h b/src/objc/rfc822/MCOAttachment.h index 7c6a0d7b..584bdece 100644 --- a/src/objc/rfc822/MCOAttachment.h +++ b/src/objc/rfc822/MCOAttachment.h @@ -34,6 +34,9 @@ // Decoded data of the part. @property (nonatomic, strong) NSData * data; + +// Returns string representation according to charset +- (NSString *) decodedString; @end diff --git a/src/objc/rfc822/MCOAttachment.mm b/src/objc/rfc822/MCOAttachment.mm index 55430f78..423ac0df 100644 --- a/src/objc/rfc822/MCOAttachment.mm +++ b/src/objc/rfc822/MCOAttachment.mm @@ -86,4 +86,10 @@ MCO_OBJC_SYNTHESIZE_DATA(setData, data) +- (NSString *) decodedString +{ + mailcore::String *result = MCO_NATIVE_INSTANCE->decodedString(); + return [NSString mco_stringWithMCString:result]; +} + @end |