cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject cordova-plugin-file git commit: CB-8351 ios: Use base64EncodedStringWithOptions instead of CordovaLib's class extension
Date Fri, 23 Jan 2015 15:06:43 GMT
Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master 003bd2d9b -> f7bfa8925


CB-8351 ios: Use base64EncodedStringWithOptions instead of CordovaLib's class extension


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/f7bfa892
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/f7bfa892
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/f7bfa892

Branch: refs/heads/master
Commit: f7bfa8925b53da037c7f537fbacaaf71d925a224
Parents: 003bd2d
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Jan 23 10:05:38 2015 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jan 23 10:05:38 2015 -0500

----------------------------------------------------------------------
 src/ios/CDVFile.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/f7bfa892/src/ios/CDVFile.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVFile.m b/src/ios/CDVFile.m
index 7242aee..4e9db14 100644
--- a/src/ios/CDVFile.m
+++ b/src/ios/CDVFile.m
@@ -868,8 +868,8 @@ NSString* const kCDVFilesystemURLPrefix = @"cdvfile";
         [fs readFileAtURL:localURI start:start end:end callback:^(NSData* data, NSString*
mimeType, CDVFileError errorCode) {
             CDVPluginResult* result = nil;
             if (data != nil) {
-                // TODO: Would be faster to base64 encode directly to the final string.
-                NSString* output = [NSString stringWithFormat:@"data:%@;base64,%@", mimeType,
[data base64EncodedString]];
+                NSString* b64str = [data base64EncodedStringWithOptions:0];
+                NSString* output = [NSString stringWithFormat:@"data:%@;base64,%@", mimeType,
b64str];
                 result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:output];
             } else {
                 result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION
messageAsInt:errorCode];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message