├── QiniuDownloadSDK.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── lintianzhi.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcuserdata │ └── lintianzhi.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ ├── QiniuDownloadSDKTests.xcscheme │ │ ├── QiniuDownloadSDK-OSXTests.xcscheme │ │ ├── QiniuDownloadSDK.xcscheme │ │ └── QiniuDownloadSDK-OSX.xcscheme └── project.pbxproj ├── QiniuDownloadSDK ├── QNAsyncRun.h ├── QiniuDownload.h ├── QNAsyncRun.m ├── QNConfig.h ├── QNConfig.m ├── QNStats.h ├── QNDownloadTask.h ├── QNDownloadManager.h ├── QNDownloadManager.m ├── QNStats.m └── QNDownloadTask.m ├── .travis.yml ├── QiniuDownloadSDKTests ├── Info.plist └── QiniuDownloadSDKTests.m ├── Podfile ├── QiniuDownload.podspec ├── README.md └── uncrustify.cfg /QiniuDownloadSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QiniuDownloadSDK.xcodeproj/project.xcworkspace/xcuserdata/lintianzhi.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiniu/objc-DownloadSDK/HEAD/QiniuDownloadSDK.xcodeproj/project.xcworkspace/xcuserdata/lintianzhi.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNAsyncRun.h: -------------------------------------------------------------------------------- 1 | // 2 | // QNAsyncRun.h 3 | // QiniuSDK 4 | // 5 | // Created by bailong on 14/10/17. 6 | // Copyright (c) 2014年 Qiniu. All rights reserved. 7 | // 8 | 9 | typedef void (^QNRun)(void); 10 | 11 | void QNAsyncRun(QNRun run); 12 | 13 | void QNAsyncRunInMain(QNRun run); 14 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QiniuDownload.h: -------------------------------------------------------------------------------- 1 | // 2 | // QiniuDownload.h 3 | // QiniuDownloadSDK 4 | // 5 | // Created by ltz on 10/19/15. 6 | // Copyright © 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | #ifndef QiniuDownload_h 10 | #define QiniuDownload_h 11 | 12 | #import "QNDownloadManager.h" 13 | #import "QNConfig.h" 14 | #import "QNDownloadTask.h" 15 | #import "QNStats.h" 16 | 17 | #endif /* QiniuDownload_h */ 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | before_install: 3 | # - brew update 4 | # - brew upgrade xctool 5 | # - gem install cocoapods 6 | before_script: 7 | - export QINIU_TEST_ENV="travis" 8 | script: 9 | - xctool -workspace QiniuSDK.xcworkspace -scheme "QiniuDownloadSDK" -sdk iphonesimulator -configuration Release test -test-sdk iphonesimulator6.0 -freshInstall -freshSimulator 10 | - xctool -workspace QiniuSDK.xcworkspace -scheme "QiniuDownloadSDK-OSX" -sdk macosx -configuration Release test -test-sdk macosx 11 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNAsyncRun.m: -------------------------------------------------------------------------------- 1 | // 2 | // QNAsyncRun.m 3 | // QiniuSDK 4 | // 5 | // Created by bailong on 14/10/17. 6 | // Copyright (c) 2014年 Qiniu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QNAsyncRun.h" 11 | 12 | void QNAsyncRun(QNRun run) { 13 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { 14 | run(); 15 | }); 16 | } 17 | 18 | void QNAsyncRunInMain(QNRun run) { 19 | dispatch_async(dispatch_get_main_queue(), ^(void) { 20 | run(); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // QNConfig.h 3 | // QiniuDownloadSDK 4 | // 5 | // Created by ltz on 10/19/15. 6 | // Copyright © 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "HappyDNS.h" 12 | 13 | 14 | @interface QNConfig : NSObject 15 | 16 | - (id) init; 17 | - (void) setDropRate:(float)rate; 18 | - (void) setPushIntervalS:(uint) interval; 19 | 20 | @property int pushDropRate; 21 | @property uint pushStatIntervalS; 22 | @property (nonatomic) NSString *statsHost; 23 | @property (nonatomic) QNDnsManager *dns; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /QiniuDownloadSDKTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | target "QiniuDownloadSDK" do 4 | platform :ios, "6.0" 5 | pod 'GZIP', '~> 1.1' 6 | pod 'Reachability', '~> 3.2' 7 | pod 'AFNetworking', '~> 2.5.0' 8 | pod 'HappyDNS', '>= 0.2' 9 | end 10 | 11 | target "QiniuDownloadSDK-OSX" do 12 | platform :osx, "10.8" 13 | pod 'GZIP', '~> 1.1' 14 | pod 'AFNetworking', '~> 2.5.0' 15 | pod 'HappyDNS', '>= 0.2' 16 | end 17 | 18 | target "QiniuDownloadSDKTests" do 19 | platform :ios, "6.0" 20 | pod 'GZIP', '~> 1.1' 21 | pod 'AGAsyncTestHelper/Shorthand' 22 | pod 'Reachability', '~> 3.2' 23 | pod 'AFNetworking', '~> 2.5.0' 24 | pod 'HappyDNS', '>= 0.2' 25 | end 26 | 27 | target "QiniuDownloadSDK-OSXTests" do 28 | platform :osx, "10.8" 29 | pod 'GZIP', '~> 1.1' 30 | pod 'AGAsyncTestHelper/Shorthand' 31 | pod 'AFNetworking', '~> 2.5.0' 32 | pod 'HappyDNS', '>= 0.2' 33 | end 34 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // QNConfig.m 3 | // QiniuDownloadSDK 4 | // 5 | // Created by ltz on 10/19/15. 6 | // Copyright © 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | #import "QNConfig.h" 10 | 11 | @implementation QNConfig 12 | 13 | 14 | - (id) init { 15 | 16 | self = [super init]; 17 | 18 | // init dns 19 | id r1 = [QNResolver systemResolver]; 20 | id r2 = [[QNResolver alloc] initWithAddres:@"223.6.6.6"]; 21 | id r3 = [[QNResolver alloc] initWithAddres:@"114.114.115.115"]; 22 | _dns = [[QNDnsManager alloc] init:[NSArray arrayWithObjects:r1,r2, r3, nil] networkInfo:[QNNetworkInfo normal ]]; 23 | 24 | _statsHost = @"http://reportqos.qiniuapi.com"; 25 | 26 | _pushDropRate = 30; 27 | _pushStatIntervalS = 300; 28 | 29 | return self; 30 | } 31 | 32 | - (void) setDropRate:(float)rate { 33 | 34 | _pushDropRate = (int)(rate*100); 35 | 36 | } 37 | - (void) setPushIntervalS:(uint) interval { 38 | 39 | _pushStatIntervalS = interval; 40 | } 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNStats.h: -------------------------------------------------------------------------------- 1 | // 2 | // QNStats.h 3 | // QiniuSDK 4 | // 5 | // Created by ltz on 9/21/15. 6 | // Copyright (c) 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #import 12 | #import "AFNetworking.h" 13 | #import "QNConfig.h" 14 | 15 | #if TARGET_OS_IPHONE 16 | #import "Reachability.h" 17 | #import 18 | #endif 19 | 20 | //QNStats *defaultStatsManager; 21 | 22 | @interface QNStats : NSObject 23 | 24 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 25 | 26 | #if TARGET_OS_IPHONE 27 | @property (nonatomic, readonly) Reachability *wifiReach; 28 | @property (nonatomic, readonly) CTTelephonyNetworkInfo *telephonyInfo; 29 | @property (atomic, readonly) NetworkStatus reachabilityStatus; 30 | #endif 31 | 32 | // 切换网络的时候需要拿本地IP 33 | @property (atomic, readonly) NSString *sip; 34 | 35 | - (instancetype) init; 36 | - (instancetype) initWithConfiguration: (QNConfig *) config; 37 | 38 | 39 | - (void) addStatics: (NSMutableDictionary *) stat; 40 | - (void) pushStats; 41 | - (NSString *) getSIP; 42 | - (NSString *) getNetType; 43 | 44 | @property int count; 45 | 46 | #endif 47 | 48 | @end 49 | 50 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNDownloadTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // QNDownloadTask.h 3 | // QiniuSDK 4 | // 5 | // Created by ltz on 10/2/15. 6 | // Copyright © 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #import 12 | 13 | void setStat(NSMutableDictionary *dic, id key, id value); 14 | 15 | 16 | 17 | typedef NSURL * (^QNDestinationBlock)(NSURL *targetPath, NSURLResponse *response); 18 | typedef void (^QNURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error); 19 | 20 | @class QNDownloadManager; 21 | 22 | @interface QNDownloadTask : NSObject 23 | 24 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 25 | 26 | - (instancetype) initWithStats:(NSMutableDictionary *)stats 27 | manager:(QNDownloadManager *)manager 28 | request:(NSURLRequest *)request 29 | progress:(NSProgress *)progress 30 | destination:(QNDestinationBlock)destination 31 | completionHandler:(QNURLSessionTaskCompletionHandler)completionHandler; 32 | 33 | - (void) cancel; 34 | - (void) resume; 35 | - (void) suspend; 36 | 37 | #endif 38 | 39 | @end 40 | 41 | -------------------------------------------------------------------------------- /QiniuDownloadSDK.xcodeproj/xcuserdata/lintianzhi.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | QiniuDownloadSDK-OSX.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | QiniuDownloadSDK-OSXTests.xcscheme 13 | 14 | orderHint 15 | 3 16 | 17 | QiniuDownloadSDK.xcscheme 18 | 19 | orderHint 20 | 0 21 | 22 | QiniuDownloadSDKTests.xcscheme 23 | 24 | orderHint 25 | 1 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | BAF8E8E11BD4DD9A00F63299 31 | 32 | primary 33 | 34 | 35 | BAF8E8F11BD4DDE400F63299 36 | 37 | primary 38 | 39 | 40 | BAF8E9001BD4DE0C00F63299 41 | 42 | primary 43 | 44 | 45 | BAF8E90D1BD4DE2000F63299 46 | 47 | primary 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNDownloadManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // QNDownloadManager.h 3 | // QiniuSDK 4 | // 5 | // Created by ltz on 9/10/15. 6 | // Copyright (c) 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "QNConfig.h" 12 | #import "QNStats.h" 13 | #import "QNDownloadTask.h" 14 | 15 | 16 | typedef NSURL * (^QNDestinationBlock)(NSURL *targetPath, NSURLResponse *response); 17 | typedef void (^QNURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error); 18 | 19 | @interface QNDownloadManager : NSObject 20 | 21 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 22 | 23 | @property (nonatomic, readonly) QNStats *statsManager; 24 | @property (nonatomic, readonly) QNConfig *config; 25 | 26 | - (instancetype) init; 27 | - (instancetype) initWithConfiguration:(QNConfig*)config 28 | statsManager:(QNStats*)statsManager; 29 | 30 | - (QNDownloadTask *) downloadTaskWithRequest:(NSURLRequest *)request 31 | progress:(NSProgress *)progress 32 | destination:(NSURL * (^__strong)(NSURL *__strong, NSURLResponse *__strong))destination 33 | completionHandler:(void (^__strong)(NSURLResponse *__strong, NSURL *__strong, NSError *__strong))completionHandler; 34 | 35 | #endif 36 | 37 | @end 38 | 39 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNDownloadManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // QNDownloadManager.m 3 | // QiniuSDK 4 | // 5 | // Created by ltz on 9/10/15. 6 | // Copyright (c) 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #import 12 | #include 13 | 14 | #import "QNAsyncRun.h" 15 | #import "HappyDNS.h" 16 | #import "QNConfig.h" 17 | #import "QNDownloadManager.h" 18 | #import "QNDownloadTask.h" 19 | 20 | @implementation QNDownloadManager 21 | 22 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 23 | 24 | 25 | - (instancetype) init { 26 | 27 | return [self initWithConfiguration:nil statsManager:nil]; 28 | } 29 | 30 | - (instancetype) initWithConfiguration:(QNConfig *)config 31 | statsManager:(QNStats *)statsManager { 32 | 33 | self = [super init]; 34 | if (config == nil) { 35 | config = [[QNConfig alloc]init]; 36 | } 37 | _config = config; 38 | 39 | // TODO: isGatherStats 40 | if (statsManager == nil) { 41 | statsManager = [[QNStats alloc] initWithConfiguration:config]; 42 | } 43 | _statsManager = statsManager; 44 | 45 | return self; 46 | } 47 | 48 | - (QNDownloadTask *) downloadTaskWithRequest:(NSURLRequest *)request 49 | progress:(NSProgress *)progress 50 | destination:(NSURL * (^__strong)(NSURL *__strong, NSURLResponse *__strong))destination 51 | completionHandler:(void (^__strong)(NSURLResponse *__strong, NSURL *__strong, NSError *__strong))completionHandler { 52 | 53 | NSMutableDictionary *stats = [[NSMutableDictionary alloc] init]; 54 | 55 | return [[QNDownloadTask alloc]initWithStats:stats 56 | manager:self request:request progress:progress destination:destination completionHandler:completionHandler]; 57 | } 58 | 59 | #endif 60 | 61 | @end 62 | 63 | -------------------------------------------------------------------------------- /QiniuDownload.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'QiniuDownload' 3 | s.version = '1.2.1' 4 | s.summary = 'Qiniu Resource Storage Download SDK for iOS and Mac' 5 | s.homepage = 'https://github.com/qiniu/objc-DownloadSDK' 6 | s.social_media_url = 'http://weibo.com/qiniutek' 7 | s.author = 'Qiniu => sdk@qiniu.com' 8 | s.source = {:git => 'https://github.com/qiniu/objc-DownloadSDK', :tag => "v#{s.version}"} 9 | 10 | s.ios.deployment_target = '6.0' 11 | s.osx.deployment_target = '10.8' 12 | 13 | s.source_files = 'QiniuDownloadSDK/*.{h,m}' 14 | s.requires_arc = true 15 | s.libraries = 'z' 16 | s.ios.dependency 'Reachability', '~> 3.2' 17 | s.dependency 'AFNetworking', '~> 2.0' 18 | s.dependency 'HappyDNS', '~> 0.2' 19 | s.dependency 'GZIP', '~> 1.1' 20 | s.license = { :type => 'MIT', :text => <<-LICENSE 21 | The MIT License (MIT) 22 | 23 | Copyright (c) 2012-2014 qiniu.com 24 | 25 | Permission is hereby granted, free of charge, to any person obtaining a copy 26 | of this software and associated documentation files (the "Software"), to deal 27 | in the Software without restriction, including without limitation the rights 28 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 29 | copies of the Software, and to permit persons to whom the Software is 30 | furnished to do so, subject to the following conditions: 31 | 32 | The above copyright notice and this permission notice shall be included in 33 | all copies or substantial portions of the Software. 34 | 35 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 36 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 37 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 38 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 39 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 40 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 41 | THE SOFTWARE. 42 | LICENSE 43 | } 44 | 45 | end 46 | -------------------------------------------------------------------------------- /QiniuDownloadSDK.xcodeproj/xcuserdata/lintianzhi.xcuserdatad/xcschemes/QiniuDownloadSDKTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /QiniuDownloadSDK.xcodeproj/xcuserdata/lintianzhi.xcuserdatad/xcschemes/QiniuDownloadSDK-OSXTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## iOS下载SDK介绍 3 | 4 | 本SDK用于获取从iOS下载性能统计。 5 | 6 | ### 原理: 7 | 8 | SDK提供了和`AFNetworking`一样的创建downloadTask的函数,封装了`NSURLSessionDownloadTask`, 9 | 也就是说在在使用SDK的时候只需要把原来创建`NSURLSessionDownloadTask`的地方修改成从这个SDK创建出一个对应的task就可以,具体的函数见下面的使用 10 | 11 | 客户通过SDK下载的时候,会在SDK内部的各个地方获取本次下载相关的数据(不包含于用户或者app相关的任何隐私数据),丢到一个数组里面。 12 | SDK内部会定时触发一个push操作,把搜集到的数据通过gzip压缩发送到服务器。之后用户可以通过七牛提供的查询页面查询自己的下载统计,或者设置监控。 13 | 14 | ### 统计分类 15 | 16 | - 下载域名 17 | - 地区分类(省,市) 18 | - DNS查询时间 19 | - DNS查询是否匹配到对应的CDN节点 20 | - 服务端响应时间 21 | - 服务端下载时间 22 | 23 | ### 额外流量: 24 | 25 | 单个统计发送的数据量有300Byte左右,经过gzip压缩200Byte左右。 26 | 客户端会把几次请求合并发送,经过gzip压缩之后平均每个统计100Byte左右,10k的数据量就可以发送100个统计点。 27 | 可以认为对手机端的流量影响较小。 28 | 如果认为这个数据量过多的话,也可以在SDK内部调节上传的比例(随机丢掉某些数据点)和发送数据点的间隔。 29 | 30 | ### 使用: 31 | 32 | ``` 33 | platform :ios, '7.0' 34 | pod "QiniuDownload", "~> 1.0" 35 | ``` 36 | 37 | 使用例子: 38 | 39 | ``` 40 | #import "QiniuDownload.h" 41 | 42 | QNDownloadManager *manager = [[QNDownloadManager alloc] init]; 43 | NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"]; 44 | NSURLRequest *request = [NSURLRequest requestWithURL:URL]; 45 | 46 | QNDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) { 47 | NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; 48 | return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]]; 49 | } completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) { 50 | NSLog(@"File downloaded to: %@", filePath); 51 | }]; 52 | [downloadTask resume]; 53 | 54 | ``` 55 | 56 | ### QNDownloadManager 57 | 58 | 新建`QNDownloadManager`类,通过它创建 `QNDownloadTask` 任务: 59 | 60 | ``` 61 | - (QNDownloadTask *) downloadTaskWithRequest:(NSURLRequest *)request 62 | progress:(NSProgress *)progress 63 | destination:(NSURL * (^__strong)(NSURL *__strong, NSURLResponse *__strong))destination 64 | completionHandler:(void (^__strong)(NSURLResponse *__strong, NSURL *__strong, NSError *__strong))completionHandler; 65 | ``` 66 | 67 | 其中: 68 | 69 | - `request`: 请求 70 | - `progress`: 下载的进度,可以为nil 71 | - `destination`: 假如需要永久存储的话,在这个回调函数里面返回结果希望存的地址 72 | - `completionHandler`: 完成后的回调函数 73 | 74 | ### QNDownloadTask 75 | 76 | ``` 77 | - (void) cancel; // 取消本次的文件下载 78 | - (void) resume; // 开始文件下载 79 | - (void) suspend; // 暂停本次文件下载 80 | ``` 81 | -------------------------------------------------------------------------------- /QiniuDownloadSDK.xcodeproj/xcuserdata/lintianzhi.xcuserdatad/xcschemes/QiniuDownloadSDK.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /QiniuDownloadSDK.xcodeproj/xcuserdata/lintianzhi.xcuserdatad/xcschemes/QiniuDownloadSDK-OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /QiniuDownloadSDKTests/QiniuDownloadSDKTests.m: -------------------------------------------------------------------------------- 1 | 2 | // QNDownloadTest.m 3 | // QiniuSDK 4 | // 5 | // Created by ltz on 9/28/15. 6 | // Copyright (c) 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "QiniuDownload.h" 13 | 14 | @interface QNDownloadTest : XCTestCase 15 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 16 | 17 | @property QNDownloadManager *dnManager; 18 | #endif 19 | 20 | @end 21 | 22 | @implementation QNDownloadTest 23 | 24 | - (void)setUp { 25 | [super setUp]; 26 | // Put setup code here. This method is called before the invocation of each test method in the class. 27 | 28 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 29 | 30 | 31 | QNConfig *cfg = [[QNConfig alloc] init]; 32 | //cfg.statsHost = @"http://192.168.210.97:2334"; // 33 | cfg.statsHost = @"http://192.168.199.202:2334"; // home 34 | cfg.statsHost = @"http://reportqos.qiniuapi.com"; 35 | [cfg setPushDropRate:0]; 36 | [cfg setPushIntervalS:1]; 37 | QNStats *stats = [[QNStats alloc] initWithConfiguration:cfg]; 38 | 39 | _dnManager = [[QNDownloadManager alloc] initWithConfiguration:cfg statsManager:stats]; 40 | #endif 41 | } 42 | 43 | - (void)tearDown { 44 | // Put teardown code here. This method is called after the invocation of each test method in the class. 45 | [super tearDown]; 46 | } 47 | 48 | - (void)testDownload { 49 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 50 | 51 | NSURL *URL = [NSURL URLWithString:@"http://ztest.qiniudn.com/gogopher.jpg"]; 52 | 53 | NSURLRequest *request = [NSURLRequest requestWithURL:URL]; 54 | __block bool done = false; 55 | __block NSError *dErr = nil; 56 | 57 | NSLog(@"start download"); 58 | for (int i = 0; i< 1; i++) { 59 | 60 | QNDownloadTask *task = [_dnManager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) { 61 | 62 | NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; 63 | NSURL *u = [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]]; 64 | NSLog(@"targetPath: %@", targetPath); 65 | NSLog(@"urll: %@", u.absoluteString); 66 | return u; 67 | } completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) { 68 | NSLog(@"File downloaded to: %@", filePath); 69 | NSLog(@"download error: %@", error); 70 | 71 | done = true; 72 | [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil]; 73 | }]; 74 | [task resume]; 75 | } 76 | 77 | AGWW_WAIT_WHILE(done==false, 60*30); 78 | AGWW_WAIT_WHILE(_dnManager.statsManager.count != 1, 60); 79 | 80 | XCTAssertNil(dErr, @"Pass"); 81 | 82 | #endif 83 | 84 | } 85 | 86 | /* 87 | - (void)testPerformanceExample { 88 | // This is an example of a performance test case. 89 | [self measureBlock:^{ 90 | // Put the code you want to measure the time of here. 91 | }]; 92 | } 93 | */ 94 | 95 | @end 96 | 97 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNStats.m: -------------------------------------------------------------------------------- 1 | // 2 | // QNStats.m 3 | // QiniuSDK 4 | // 5 | // Created by ltz on 9/21/15. 6 | // Copyright (c) 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | #if TARGET_OS_IPHONE 10 | #import 11 | #import "Reachability.h" 12 | #endif 13 | 14 | #include 15 | #import "GZIP.h" 16 | #import "QNStats.h" 17 | #import "QNConfig.h" 18 | 19 | 20 | @interface QNStats () 21 | 22 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 23 | 24 | @property (nonatomic) QNConfig *config; 25 | @property (nonatomic) AFHTTPRequestOperationManager *httpManager; 26 | @property (nonatomic) NSMutableArray *statsBuffer; 27 | @property (nonatomic) NSLock *bufLock; 28 | 29 | @property (nonatomic) NSTimer *pushTimer; 30 | @property (nonatomic) NSTimer *getIPTimer; 31 | 32 | 33 | 34 | // ... 35 | @property (atomic) NSString *radioAccessTechnology; 36 | 37 | @property (nonatomic) NSString *phoneModel; // dev 38 | @property (nonatomic) NSString *systemName; // os 39 | @property (nonatomic) NSString *systemVersion; // sysv 40 | @property (nonatomic) NSString *appName; // app 41 | @property (nonatomic) NSString *appVersion; // appv 42 | 43 | #endif 44 | 45 | @end 46 | 47 | @implementation QNStats 48 | 49 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 50 | 51 | - (instancetype) init { 52 | 53 | return [self initWithConfiguration:nil]; 54 | } 55 | 56 | - (instancetype) initWithConfiguration: (QNConfig *) config { 57 | 58 | self = [super init]; 59 | 60 | if (config == nil) { 61 | config = [[QNConfig alloc]init]; 62 | } 63 | _config = config; 64 | 65 | _statsBuffer = [[NSMutableArray alloc] init]; 66 | _bufLock = [[NSLock alloc] init]; 67 | 68 | _httpManager = [[AFHTTPRequestOperationManager alloc] init]; 69 | _httpManager.responseSerializer = [AFJSONResponseSerializer serializer]; 70 | 71 | _count = 0; 72 | 73 | // get out ip first time 74 | [self getOutIp]; 75 | 76 | #if TARGET_OS_IPHONE 77 | 78 | // radio access technology 79 | _telephonyInfo = [CTTelephonyNetworkInfo new]; 80 | _radioAccessTechnology = _telephonyInfo.currentRadioAccessTechnology; 81 | 82 | NSLog(@"Current Radio Access Technology: %@", _radioAccessTechnology); 83 | [NSNotificationCenter.defaultCenter addObserverForName:CTRadioAccessTechnologyDidChangeNotification 84 | object:nil 85 | queue:nil 86 | usingBlock:^(NSNotification *note) { 87 | _radioAccessTechnology = _telephonyInfo.currentRadioAccessTechnology; 88 | NSLog(@"New Radio Access Technology: %@", _telephonyInfo.currentRadioAccessTechnology); 89 | [self getOutIp]; 90 | }]; 91 | 92 | // WiFi, WLAN, or nothing 93 | _wifiReach = [Reachability reachabilityForInternetConnection]; 94 | _reachabilityStatus = _wifiReach.currentReachabilityStatus; 95 | 96 | [NSNotificationCenter.defaultCenter addObserverForName:kReachabilityChangedNotification 97 | object:nil 98 | queue:nil 99 | usingBlock:^(NSNotification *note) { 100 | _reachabilityStatus = _wifiReach.currentReachabilityStatus; 101 | 102 | if (_reachabilityStatus != NotReachable) { 103 | [self getOutIp]; 104 | } 105 | }]; 106 | [_wifiReach startNotifier]; 107 | 108 | // init device information 109 | _phoneModel = [[UIDevice currentDevice] model]; 110 | _systemName = [[UIDevice currentDevice] systemName]; 111 | _systemVersion = [[UIDevice currentDevice] systemVersion]; 112 | #elif TARGET_OS_OSX 113 | _phoneModel = @"" 114 | _systemName = @"osx" 115 | _systemVersion = @""; 116 | #else 117 | _phoneModel = @""; 118 | _systemName = @""; 119 | _systemVersion = @""; 120 | #endif 121 | 122 | // timer for push 123 | _pushTimer = [NSTimer scheduledTimerWithTimeInterval:_config.pushStatIntervalS target:self selector:@selector(pushStats) userInfo:nil repeats:YES]; 124 | [_pushTimer fire]; 125 | 126 | _getIPTimer = [NSTimer scheduledTimerWithTimeInterval:300 target:self selector:@selector(getOutIp) userInfo:nil repeats:YES]; 127 | [_getIPTimer fire]; 128 | 129 | 130 | 131 | NSDictionary *info = [[NSBundle mainBundle] infoDictionary]; 132 | _appName = [info objectForKey:@"CFBundleDisplayName"]; 133 | NSString *majorVersion = [info objectForKey:@"CFBundleShortVersionString"]; 134 | NSString *minorVersion = [info objectForKey:@"CFBundleVersion"]; 135 | _appVersion = [NSString stringWithFormat:@"%@(%@)", majorVersion, minorVersion]; 136 | 137 | if (_appName == nil) { 138 | _appName = @""; 139 | } 140 | if (_appVersion == nil) { 141 | _appVersion = @""; 142 | } 143 | 144 | return self; 145 | } 146 | 147 | - (void) addStatics:(NSMutableDictionary *)stat { 148 | 149 | [_bufLock lock]; 150 | [_statsBuffer addObject:stat]; 151 | [_bufLock unlock]; 152 | } 153 | 154 | - (BOOL) shouldDrop { 155 | int r = arc4random_uniform(100); 156 | return r < _config.pushDropRate; 157 | } 158 | 159 | - (void) pushStats { 160 | 161 | @synchronized(self) { 162 | 163 | #if TARGET_OS_IPHONE 164 | if (_reachabilityStatus == NotReachable) { 165 | return; 166 | } 167 | #endif 168 | 169 | [_bufLock lock]; 170 | if ([_statsBuffer count] == 0) { 171 | [_bufLock unlock]; 172 | return; 173 | } 174 | NSMutableArray *reqs = [[NSMutableArray alloc] init]; 175 | for (int i=0; i<[_statsBuffer count]; i++) { 176 | if ([self shouldDrop]) { 177 | continue; 178 | } 179 | [reqs addObject:[_statsBuffer objectAtIndex:i]]; 180 | } 181 | //NSMutableArray *reqs = [[NSMutableArray alloc] initWithArray:_statsBuffer copyItems:YES]; 182 | [_statsBuffer removeAllObjects]; 183 | [_bufLock unlock]; 184 | 185 | if ([reqs count] != 0) { 186 | long long now = (long long)([[NSDate date] timeIntervalSince1970]* 1000000000); 187 | for (int i=0; i<[reqs count]; i++) { 188 | NSMutableDictionary *stat = [[reqs objectAtIndex:i] mutableCopy]; 189 | long long st = [[stat valueForKey:@"st"] longLongValue]; 190 | NSNumber *pi = [NSNumber numberWithLongLong:(now - st)]; 191 | [stat setObject:pi forKey:@"pi"]; 192 | [reqs setObject:stat atIndexedSubscript:i]; 193 | } 194 | NSDictionary *parameters = @{@"dev": _phoneModel, @"os": _systemName, @"sysv": _systemVersion, 195 | @"app": _appName, @"appv": _appVersion, 196 | @"stats": reqs, @"v": @"0.1"}; 197 | //NSLog(@"stats: %@", reqs); 198 | NSData *data = [NSJSONSerialization dataWithJSONObject:parameters options:kNilOptions error:nil]; 199 | data = [data gzippedDataWithCompressionLevel:0.7]; 200 | // NSURLRequest *req = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:[_config.statsHost stringByAppendingString:@"/v1/stats"] parameters:parameters error:nil]; 201 | NSMutableURLRequest *req = [[NSMutableURLRequest alloc] init]; 202 | 203 | [req setHTTPMethod:@"POST"]; 204 | [req setURL:[NSURL URLWithString:[_config.statsHost stringByAppendingString:@"/v1/stats"]]]; 205 | [req setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; 206 | [req setValue:[NSString stringWithFormat:@"%lu", (unsigned long)[data length]] forHTTPHeaderField:@"Content-Length"]; 207 | [req setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"]; 208 | [req setHTTPBody:data]; 209 | 210 | AFHTTPRequestOperation *operation = [_httpManager HTTPRequestOperationWithRequest:req success:^(AFHTTPRequestOperation *operation, id responseObject) { 211 | _count += [reqs count]; 212 | 213 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 214 | NSLog(@"post stats failed, %@", error); 215 | }]; 216 | [_httpManager.operationQueue addOperation:operation]; 217 | } 218 | } 219 | } 220 | 221 | - (void) getOutIp { 222 | 223 | [_httpManager GET:[_config.statsHost stringByAppendingString:@"/v1/ip"] parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { 224 | NSDictionary *rst = (NSDictionary *)responseObject; 225 | _sip = [rst valueForKey:@"ip"]; 226 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 227 | NSLog(@"get ip failed: %@", error); 228 | }]; 229 | } 230 | 231 | 232 | - (NSString *) getSIP { 233 | 234 | return _sip; 235 | } 236 | 237 | - (NSString *) getNetType { 238 | #if TARGET_OS_IPHONE 239 | if (_reachabilityStatus == ReachableViaWiFi) { 240 | return @"wifi"; 241 | } else if (_reachabilityStatus == ReachableViaWWAN) { 242 | return @"wan"; 243 | } 244 | #elif TARGET_OS_MAC 245 | return @"wifi"; 246 | #endif 247 | 248 | return @""; 249 | } 250 | 251 | 252 | #endif 253 | 254 | @end 255 | 256 | -------------------------------------------------------------------------------- /QiniuDownloadSDK/QNDownloadTask.m: -------------------------------------------------------------------------------- 1 | // 2 | // QNDownloadTask.m 3 | // QiniuSDK 4 | // 5 | // Created by ltz on 10/2/15. 6 | // Copyright © 2015 Qiniu. All rights reserved. 7 | // 8 | 9 | 10 | 11 | 12 | #include 13 | 14 | #import "QNAsyncRun.h" 15 | #import "QNDownloadTask.h" 16 | #import "QNDownloadManager.h" 17 | 18 | void setStat(NSMutableDictionary *dic, id key, id value) { 19 | if (value == nil) { 20 | return; 21 | } 22 | [dic setObject:value forKey:key]; 23 | } 24 | 25 | BOOL isValidIPAddress(NSString *ip) { 26 | const char *utf8 = [ip UTF8String]; 27 | if (utf8 == nil) { 28 | return true; 29 | } 30 | int success; 31 | 32 | struct in_addr dst; 33 | success = inet_pton(AF_INET, utf8, &dst); 34 | if (success != 1) { 35 | struct in6_addr dst6; 36 | success = inet_pton(AF_INET6, utf8, &dst6); 37 | } 38 | 39 | return success == 1; 40 | } 41 | 42 | NSString *errorFromDesc(NSString *desc) { 43 | if ([desc isEqualToString:@"Could not connect to the server."]) { 44 | return @"ErrConnectFailed"; 45 | } 46 | if ([desc isEqualToString:@"The network connection was lost."]) { 47 | return @"ErrBrokenConnection"; 48 | } 49 | if ([desc isEqualToString:@"A server with the specified hostname could not be found."]) { 50 | return @"ErrDomainNotFound"; 51 | } 52 | if ([desc isEqualToString:@"The request timed out."]) { 53 | return @"ErrTimeout"; 54 | } 55 | NSLog(@"unknown: %@", desc); 56 | return @"ErrUnknown"; 57 | } 58 | 59 | typedef enum { 60 | TaskFailed = 0, 61 | TaskNotStarted, 62 | TaskGenerating, 63 | TaskNormal 64 | } TaskStat; 65 | 66 | typedef enum { 67 | TaskCreate = 0, 68 | TaskResume, 69 | TaskSuspend, 70 | TaskCancel 71 | } TaskAction; 72 | 73 | @interface QNDownloadTask () 74 | 75 | @property (nonatomic) QNDownloadManager *manager; 76 | @property (nonatomic) NSURLSessionTask *realTask; 77 | @property (nonatomic) NSMutableDictionary *stats; 78 | @property (nonatomic) NSLock *lock; 79 | @property TaskStat taskStat; 80 | @property TaskAction expectedAction; 81 | 82 | 83 | @property (nonatomic) NSURLRequest *oldRequest; 84 | @property (nonatomic) NSProgress *progress; 85 | @property (nonatomic, strong) QNDestinationBlock destination; 86 | @property (nonatomic, strong) QNURLSessionTaskCompletionHandler completionHandler; 87 | 88 | @end 89 | 90 | @implementation QNDownloadTask 91 | 92 | #if ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) &&__IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || ( defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) 93 | 94 | - (instancetype) initWithStats:(NSMutableDictionary *)stats 95 | manager:(QNDownloadManager *)manager 96 | request:(NSURLRequest *)request 97 | progress:(NSProgress *)progress 98 | destination:(QNDestinationBlock) 99 | destination completionHandler:(QNURLSessionTaskCompletionHandler)completionHandler { 100 | 101 | self = [super init]; 102 | _stats = stats; 103 | _oldRequest = request; 104 | _progress = progress; 105 | _destination = destination; 106 | _completionHandler = completionHandler; 107 | 108 | _realTask = nil; 109 | 110 | _manager = manager; 111 | _taskStat = TaskNotStarted; 112 | _expectedAction = TaskCreate; 113 | return self; 114 | } 115 | 116 | 117 | - (NSURLRequest *) newRequest:(NSURLRequest *)request { 118 | 119 | NSString *host = request.URL.host; 120 | setStat(_stats, @"domain", host); 121 | 122 | if (!isValidIPAddress(host)) { 123 | 124 | 125 | NSDate *s0 = [NSDate date]; 126 | // 查询DNS 127 | NSArray *ips = [_manager.config.dns queryWithDomain:[[QNDomain alloc] init:host hostsFirst:NO hasCname:YES]]; 128 | 129 | 130 | // 记录DNS查询时间 131 | NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:s0]; 132 | [_stats setObject:[NSNumber numberWithInt:(int)(interval*1000)] forKey:@"dt"]; 133 | if ([ips count] == 0) { 134 | // error; 135 | setStat(_stats, @"dnse", @"1"); 136 | return nil; 137 | } 138 | 139 | // 记录实际请求的IP 140 | // [stats setObject:ips[0] forKey:@"ip"]; 141 | setStat(_stats, @"ip", ips[0]); 142 | NSRange range = [request.URL.absoluteString rangeOfString:request.URL.host]; 143 | NSString *newURL = [request.URL.absoluteString stringByReplacingCharactersInRange:range 144 | withString:ips[0]]; 145 | 146 | NSMutableURLRequest *newRequest = [request mutableCopy]; 147 | newRequest.URL = [[NSURL alloc] initWithString:newURL]; 148 | [newRequest setValue:host forHTTPHeaderField:@"Host"]; 149 | request = newRequest; 150 | 151 | } else { 152 | setStat(_stats, @"ip", host); 153 | } 154 | 155 | return request; 156 | } 157 | 158 | - (NSURLSessionDownloadTask *) generateDownloadTask:(NSURLRequest *)request { 159 | 160 | NSURLRequest *newRequest = [self newRequest:request]; 161 | if (newRequest == nil) { 162 | newRequest = request; 163 | } 164 | 165 | 166 | NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:[NSOperationQueue mainQueue]]; 167 | 168 | return [session downloadTaskWithRequest:request]; 169 | } 170 | 171 | 172 | - (void) cancel { 173 | [_lock lock]; 174 | if (_taskStat != TaskNormal) { 175 | _expectedAction = TaskCancel; 176 | [_lock unlock]; 177 | return; 178 | } 179 | [_lock unlock]; 180 | 181 | [_realTask cancel]; 182 | } 183 | - (void) resume { 184 | 185 | [_lock lock]; 186 | 187 | if (_taskStat == TaskFailed || _taskStat == TaskGenerating) { 188 | // 如果是 之前运行过resume失败,或者是resume正在产生task,这时候不执行就可以; 189 | [_lock unlock]; 190 | return; 191 | } 192 | 193 | if (_taskStat == TaskNormal) { 194 | [_lock unlock]; 195 | // 曾经suspend过的记录有问题,不上报 196 | [_stats setObject:[NSNumber numberWithBool:true] forKey:@"invalid"]; 197 | [_realTask resume]; 198 | return; 199 | } 200 | 201 | // TaskNotStarted 202 | _taskStat = TaskGenerating; 203 | [_lock unlock]; 204 | 205 | 206 | QNAsyncRun(^{ 207 | 208 | // 产生task的过程中会需要去查询DNS,所以用异步操作 209 | _realTask = [self generateDownloadTask:_oldRequest]; 210 | 211 | setStat(_stats, @"net", [_manager.statsManager getNetType]); 212 | 213 | [_lock lock]; 214 | 215 | // 首先设置产生task的状态: 失败或者成功 216 | if (_realTask == nil) { 217 | _taskStat = TaskFailed; 218 | [_lock unlock]; 219 | return; 220 | } 221 | _taskStat = TaskNormal; 222 | 223 | // task 产生成功之后,需要判断在产生期间外部是否设置了动作 224 | if (_expectedAction == TaskCancel) { 225 | [_lock unlock]; 226 | [_realTask cancel]; 227 | return; 228 | } 229 | if (_expectedAction == TaskSuspend) { 230 | [_lock unlock]; 231 | return; 232 | } 233 | 234 | // 首次启动的时候记录启动时间,中间如果有暂停或者取消,那么本次的记录值可以作废,因为开始时间已经不对了 235 | // 不过实际上可以通过progress拿到suspend或者cancel时下载好的部分数据,但是部分数据是准的吗? 236 | NSTimeInterval now = [[NSDate date] timeIntervalSince1970]; 237 | [_stats setObject: [NSNumber numberWithLongLong:(long long)(now*1000000000)] forKey:@"st"]; 238 | 239 | [_lock unlock]; 240 | 241 | setStat(_stats, @"sip", [_manager.statsManager getSIP]); 242 | [_realTask resume]; 243 | }); 244 | 245 | } 246 | - (void) suspend { 247 | 248 | [_lock lock]; 249 | 250 | if (_taskStat != TaskNormal) { 251 | _expectedAction = TaskSuspend; 252 | [_lock unlock]; 253 | return; 254 | } 255 | [_lock unlock]; 256 | 257 | [_realTask suspend]; 258 | } 259 | 260 | - (void) URLSession:(NSURLSession * _Nonnull)session 261 | task:(NSURLSessionTask * _Nonnull)task 262 | didCompleteWithError:(NSError * _Nullable)error { 263 | 264 | if (!error) { 265 | return; 266 | } 267 | setStat(_stats, @"rst", errorFromDesc([error localizedDescription])); 268 | [_stats removeObjectForKey:@"invalid"]; 269 | [_manager.statsManager addStatics:_stats]; 270 | 271 | _completionHandler(nil, nil, error); 272 | } 273 | - (void) URLSession:(NSURLSession *)session 274 | downloadTask:(NSURLSessionDownloadTask *)downloadTask 275 | didResumeAtOffset:(int64_t)fileOffset 276 | expectedTotalBytes:(int64_t)expectedTotalBytes { 277 | 278 | if (_progress == nil) { 279 | return; 280 | } 281 | _progress.totalUnitCount = expectedTotalBytes; 282 | _progress.completedUnitCount = fileOffset; 283 | } 284 | 285 | - (void) URLSession:(NSURLSession *)session 286 | downloadTask:(NSURLSessionDownloadTask *)downloadTask 287 | didWriteData:(int64_t)bytesWritten 288 | totalBytesWritten:(int64_t)totalBytesWritten 289 | totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite { 290 | 291 | if (bytesWritten == totalBytesWritten) { 292 | setStat(_stats, @"fnb", [NSNumber numberWithLongLong:bytesWritten]); 293 | long long now = (long long)([[NSDate date] timeIntervalSince1970]* 1000000000); 294 | long long st = [[_stats valueForKey:@"st"] longLongValue]; 295 | NSNumber *fnbt = [NSNumber numberWithLongLong:(now - st)/1000000]; 296 | setStat(_stats, @"fnbt", fnbt); 297 | } 298 | if (_progress == nil) { 299 | return; 300 | } 301 | 302 | _progress.totalUnitCount = totalBytesExpectedToWrite; 303 | _progress.completedUnitCount = totalBytesWritten; 304 | } 305 | 306 | - (void) URLSession:(NSURLSession *)session 307 | downloadTask:(NSURLSessionDownloadTask *)downloadTask 308 | didFinishDownloadingToURL:(NSURL *)location { 309 | 310 | NSHTTPURLResponse *httpResponse = nil; 311 | if (downloadTask.response != nil) { 312 | httpResponse = (NSHTTPURLResponse *)downloadTask.response; 313 | } 314 | if (![_stats objectForKey:@"invalid"]) { 315 | // update stats 316 | 317 | // costed time 318 | long long now = (long long)([[NSDate date] timeIntervalSince1970]* 1000000000); 319 | long long st = [[_stats valueForKey:@"st"] longLongValue]; 320 | NSNumber *td = [NSNumber numberWithLongLong:(now - st)/1000000]; 321 | setStat(_stats, @"td", td); 322 | 323 | // size 324 | if (downloadTask.response != nil) { 325 | [_stats setObject:[NSNumber numberWithInteger:[httpResponse statusCode]] forKey:@"code"]; 326 | 327 | [_stats setObject:@"Success" forKey:@"rst"]; 328 | 329 | if ([httpResponse statusCode]/100 == 2) { 330 | if (httpResponse.expectedContentLength != NSURLResponseUnknownLength) { 331 | [_stats setObject:[NSNumber numberWithLongLong:httpResponse.expectedContentLength] forKey:@"bd"]; 332 | } else { 333 | NSNumber *fileSizeValue = nil; 334 | 335 | [location getResourceValue:&fileSizeValue forKey:NSURLFileSizeKey error:nil]; 336 | if (fileSizeValue) { 337 | [_stats setObject:fileSizeValue forKey:@"bd"]; 338 | } 339 | } 340 | } 341 | 342 | } else { 343 | [_stats setObject:@"error" forKey:@"rst"]; 344 | } 345 | 346 | [_manager.statsManager addStatics:_stats]; 347 | } else { 348 | // 非法的数据不上报 349 | _stats = nil; 350 | } 351 | 352 | if (downloadTask.response == nil) { 353 | _completionHandler(nil, nil, [NSError errorWithDomain:@"qiniu" code:98 userInfo: @{@"error": @"no response"}]); 354 | return; 355 | } 356 | if ([httpResponse statusCode]/100 != 2) { 357 | _completionHandler(downloadTask.response, nil, [NSError errorWithDomain:@"qiniu" code:99 userInfo: @{@"code": [NSNumber numberWithInteger:[httpResponse statusCode]]}]); 358 | return; 359 | } 360 | // mv to expected location and call completionHandler 361 | NSURL *mvDestination = location; 362 | if (_destination) { 363 | mvDestination = _destination(location, downloadTask.response); 364 | if (mvDestination) { 365 | NSError *fileManagerError = nil; 366 | [[NSFileManager defaultManager] moveItemAtPath:location toPath:mvDestination error:&fileManagerError]; 367 | 368 | if (fileManagerError) { 369 | NSDictionary *dic = [NSDictionary dictionaryWithDictionary:[fileManagerError userInfo]]; 370 | NSError *newError = [NSError errorWithDomain:[fileManagerError domain] code:97 userInfo:dic]; 371 | _completionHandler(downloadTask.response, mvDestination, newError); 372 | 373 | return; 374 | } 375 | } 376 | } 377 | _completionHandler(downloadTask.response, mvDestination, nil); 378 | } 379 | 380 | #endif 381 | 382 | @end 383 | 384 | -------------------------------------------------------------------------------- /QiniuDownloadSDK.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2F3278C99D76E738AC08D381 /* libPods-QiniuDownloadSDK-OSX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C90540F10FE1A810EA5A737 /* libPods-QiniuDownloadSDK-OSX.a */; }; 11 | 3A19A70838DDE115FFA5E8A1 /* libPods-QiniuDownloadSDKTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECB2046E96438B5541F6369C /* libPods-QiniuDownloadSDKTests.a */; }; 12 | 9B57FA16F218392BF7EFA0FE /* libPods-QiniuDownloadSDK-OSXTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8557EDA611A5FEC44A1EEFD /* libPods-QiniuDownloadSDK-OSXTests.a */; }; 13 | BAD6BEED1BD4EC5600370C48 /* QiniuDownloadSDKTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E8F41BD4DDE400F63299 /* QiniuDownloadSDKTests.m */; }; 14 | BAD6BEF21BD543D100370C48 /* QiniuDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD6BEF11BD543D100370C48 /* QiniuDownload.h */; settings = {ASSET_TAGS = (); }; }; 15 | BAF8E8F51BD4DDE400F63299 /* QiniuDownloadSDKTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E8F41BD4DDE400F63299 /* QiniuDownloadSDKTests.m */; }; 16 | BAF8E8F71BD4DDE400F63299 /* libQiniuDownloadSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BAF8E8E21BD4DD9A00F63299 /* libQiniuDownloadSDK.a */; settings = {ASSET_TAGS = (); }; }; 17 | BAF8E9131BD4DE2000F63299 /* libQiniuDownloadSDK-OSX.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BAF8E9011BD4DE0C00F63299 /* libQiniuDownloadSDK-OSX.dylib */; settings = {ASSET_TAGS = (); }; }; 18 | BAF8E9271BD4DEAE00F63299 /* QNAsyncRun.h in Headers */ = {isa = PBXBuildFile; fileRef = BAF8E91D1BD4DEAE00F63299 /* QNAsyncRun.h */; settings = {ASSET_TAGS = (); }; }; 19 | BAF8E9281BD4DEAE00F63299 /* QNAsyncRun.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E91E1BD4DEAE00F63299 /* QNAsyncRun.m */; settings = {ASSET_TAGS = (); }; }; 20 | BAF8E9291BD4DEAE00F63299 /* QNAsyncRun.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E91E1BD4DEAE00F63299 /* QNAsyncRun.m */; settings = {ASSET_TAGS = (); }; }; 21 | BAF8E92A1BD4DEAE00F63299 /* QNDownloadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = BAF8E91F1BD4DEAE00F63299 /* QNDownloadTask.h */; settings = {ASSET_TAGS = (); }; }; 22 | BAF8E92B1BD4DEAE00F63299 /* QNDownloadTask.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9201BD4DEAE00F63299 /* QNDownloadTask.m */; settings = {ASSET_TAGS = (); }; }; 23 | BAF8E92C1BD4DEAE00F63299 /* QNDownloadTask.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9201BD4DEAE00F63299 /* QNDownloadTask.m */; settings = {ASSET_TAGS = (); }; }; 24 | BAF8E92D1BD4DEAE00F63299 /* QNStats.h in Headers */ = {isa = PBXBuildFile; fileRef = BAF8E9211BD4DEAE00F63299 /* QNStats.h */; settings = {ASSET_TAGS = (); }; }; 25 | BAF8E92E1BD4DEAE00F63299 /* QNDownloadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = BAF8E9221BD4DEAE00F63299 /* QNDownloadManager.h */; settings = {ASSET_TAGS = (); }; }; 26 | BAF8E92F1BD4DEAE00F63299 /* QNStats.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9231BD4DEAE00F63299 /* QNStats.m */; settings = {ASSET_TAGS = (); }; }; 27 | BAF8E9301BD4DEAE00F63299 /* QNStats.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9231BD4DEAE00F63299 /* QNStats.m */; settings = {ASSET_TAGS = (); }; }; 28 | BAF8E9311BD4DEAE00F63299 /* QNConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = BAF8E9241BD4DEAE00F63299 /* QNConfig.h */; settings = {ASSET_TAGS = (); }; }; 29 | BAF8E9321BD4DEAE00F63299 /* QNConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9251BD4DEAE00F63299 /* QNConfig.m */; settings = {ASSET_TAGS = (); }; }; 30 | BAF8E9331BD4DEAE00F63299 /* QNConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9251BD4DEAE00F63299 /* QNConfig.m */; settings = {ASSET_TAGS = (); }; }; 31 | BAF8E9341BD4DEAE00F63299 /* QNDownloadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9261BD4DEAE00F63299 /* QNDownloadManager.m */; settings = {ASSET_TAGS = (); }; }; 32 | BAF8E9351BD4DEAE00F63299 /* QNDownloadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8E9261BD4DEAE00F63299 /* QNDownloadManager.m */; settings = {ASSET_TAGS = (); }; }; 33 | BF187DC55647EFFB6FDA1567 /* libPods-QiniuDownloadSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EAC2585A983350749BF0F2C /* libPods-QiniuDownloadSDK.a */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | BAF8E8F81BD4DDE400F63299 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = BAF8E8DA1BD4DD9A00F63299 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = BAF8E8E11BD4DD9A00F63299; 42 | remoteInfo = QiniuDownloadSDK; 43 | }; 44 | BAF8E9141BD4DE2000F63299 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = BAF8E8DA1BD4DD9A00F63299 /* Project object */; 47 | proxyType = 1; 48 | remoteGlobalIDString = BAF8E9001BD4DE0C00F63299; 49 | remoteInfo = "QiniuDownloadSDK-OSX"; 50 | }; 51 | /* End PBXContainerItemProxy section */ 52 | 53 | /* Begin PBXCopyFilesBuildPhase section */ 54 | BAF8E8E01BD4DD9A00F63299 /* CopyFiles */ = { 55 | isa = PBXCopyFilesBuildPhase; 56 | buildActionMask = 2147483647; 57 | dstPath = "include/$(PRODUCT_NAME)"; 58 | dstSubfolderSpec = 16; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXCopyFilesBuildPhase section */ 64 | 65 | /* Begin PBXFileReference section */ 66 | 06A65219A9113B4A57F53083 /* Pods-QiniuDownloadSDK.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDK.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDK/Pods-QiniuDownloadSDK.debug.xcconfig"; sourceTree = ""; }; 67 | 3EAC2585A983350749BF0F2C /* libPods-QiniuDownloadSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QiniuDownloadSDK.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 5C90540F10FE1A810EA5A737 /* libPods-QiniuDownloadSDK-OSX.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QiniuDownloadSDK-OSX.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | 607448C099777063F81EE418 /* Pods-QiniuDownloadSDKTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDKTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDKTests/Pods-QiniuDownloadSDKTests.release.xcconfig"; sourceTree = ""; }; 70 | 7E9494AD1FB8EC51AB1E4850 /* Pods-QiniuDownloadSDK-OSX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDK-OSX.release.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDK-OSX/Pods-QiniuDownloadSDK-OSX.release.xcconfig"; sourceTree = ""; }; 71 | 8EB66AD9CD931F49EBD4563D /* Pods-QiniuDownloadSDK-OSXTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDK-OSXTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDK-OSXTests/Pods-QiniuDownloadSDK-OSXTests.release.xcconfig"; sourceTree = ""; }; 72 | 935913027F332B0DD9FD7B3B /* Pods-QiniuDownloadSDK.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDK.release.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDK/Pods-QiniuDownloadSDK.release.xcconfig"; sourceTree = ""; }; 73 | 9DEFC1D5C1C7AEB01EE66310 /* Pods-QiniuDownloadSDKTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDKTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDKTests/Pods-QiniuDownloadSDKTests.debug.xcconfig"; sourceTree = ""; }; 74 | BAD6BEF11BD543D100370C48 /* QiniuDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QiniuDownload.h; sourceTree = ""; }; 75 | BAF8E8E21BD4DD9A00F63299 /* libQiniuDownloadSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libQiniuDownloadSDK.a; sourceTree = BUILT_PRODUCTS_DIR; }; 76 | BAF8E8F21BD4DDE400F63299 /* QiniuDownloadSDKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QiniuDownloadSDKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 77 | BAF8E8F41BD4DDE400F63299 /* QiniuDownloadSDKTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QiniuDownloadSDKTests.m; sourceTree = ""; }; 78 | BAF8E8F61BD4DDE400F63299 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79 | BAF8E9011BD4DE0C00F63299 /* libQiniuDownloadSDK-OSX.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "libQiniuDownloadSDK-OSX.dylib"; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | BAF8E90E1BD4DE2000F63299 /* QiniuDownloadSDK-OSXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "QiniuDownloadSDK-OSXTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 81 | BAF8E91D1BD4DEAE00F63299 /* QNAsyncRun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNAsyncRun.h; sourceTree = ""; }; 82 | BAF8E91E1BD4DEAE00F63299 /* QNAsyncRun.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNAsyncRun.m; sourceTree = ""; }; 83 | BAF8E91F1BD4DEAE00F63299 /* QNDownloadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNDownloadTask.h; sourceTree = ""; }; 84 | BAF8E9201BD4DEAE00F63299 /* QNDownloadTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNDownloadTask.m; sourceTree = ""; }; 85 | BAF8E9211BD4DEAE00F63299 /* QNStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNStats.h; sourceTree = ""; }; 86 | BAF8E9221BD4DEAE00F63299 /* QNDownloadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNDownloadManager.h; sourceTree = ""; }; 87 | BAF8E9231BD4DEAE00F63299 /* QNStats.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNStats.m; sourceTree = ""; }; 88 | BAF8E9241BD4DEAE00F63299 /* QNConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QNConfig.h; sourceTree = ""; }; 89 | BAF8E9251BD4DEAE00F63299 /* QNConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNConfig.m; sourceTree = ""; }; 90 | BAF8E9261BD4DEAE00F63299 /* QNDownloadManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QNDownloadManager.m; sourceTree = ""; }; 91 | D135E3E5DD9954EAA1E63532 /* Pods-QiniuDownloadSDK-OSXTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDK-OSXTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDK-OSXTests/Pods-QiniuDownloadSDK-OSXTests.debug.xcconfig"; sourceTree = ""; }; 92 | E3820CA9BBF98C2B8EBFC3E4 /* Pods-QiniuDownloadSDK-OSX.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuDownloadSDK-OSX.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuDownloadSDK-OSX/Pods-QiniuDownloadSDK-OSX.debug.xcconfig"; sourceTree = ""; }; 93 | ECB2046E96438B5541F6369C /* libPods-QiniuDownloadSDKTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QiniuDownloadSDKTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 94 | F8557EDA611A5FEC44A1EEFD /* libPods-QiniuDownloadSDK-OSXTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QiniuDownloadSDK-OSXTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 95 | /* End PBXFileReference section */ 96 | 97 | /* Begin PBXFrameworksBuildPhase section */ 98 | BAF8E8DF1BD4DD9A00F63299 /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | BF187DC55647EFFB6FDA1567 /* libPods-QiniuDownloadSDK.a in Frameworks */, 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | BAF8E8EF1BD4DDE400F63299 /* Frameworks */ = { 107 | isa = PBXFrameworksBuildPhase; 108 | buildActionMask = 2147483647; 109 | files = ( 110 | BAF8E8F71BD4DDE400F63299 /* libQiniuDownloadSDK.a in Frameworks */, 111 | 3A19A70838DDE115FFA5E8A1 /* libPods-QiniuDownloadSDKTests.a in Frameworks */, 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | BAF8E8FE1BD4DE0C00F63299 /* Frameworks */ = { 116 | isa = PBXFrameworksBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | 2F3278C99D76E738AC08D381 /* libPods-QiniuDownloadSDK-OSX.a in Frameworks */, 120 | ); 121 | runOnlyForDeploymentPostprocessing = 0; 122 | }; 123 | BAF8E90B1BD4DE2000F63299 /* Frameworks */ = { 124 | isa = PBXFrameworksBuildPhase; 125 | buildActionMask = 2147483647; 126 | files = ( 127 | BAF8E9131BD4DE2000F63299 /* libQiniuDownloadSDK-OSX.dylib in Frameworks */, 128 | 9B57FA16F218392BF7EFA0FE /* libPods-QiniuDownloadSDK-OSXTests.a in Frameworks */, 129 | ); 130 | runOnlyForDeploymentPostprocessing = 0; 131 | }; 132 | /* End PBXFrameworksBuildPhase section */ 133 | 134 | /* Begin PBXGroup section */ 135 | 3FD1F6660EEB0B887F759377 /* Pods */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 06A65219A9113B4A57F53083 /* Pods-QiniuDownloadSDK.debug.xcconfig */, 139 | 935913027F332B0DD9FD7B3B /* Pods-QiniuDownloadSDK.release.xcconfig */, 140 | E3820CA9BBF98C2B8EBFC3E4 /* Pods-QiniuDownloadSDK-OSX.debug.xcconfig */, 141 | 7E9494AD1FB8EC51AB1E4850 /* Pods-QiniuDownloadSDK-OSX.release.xcconfig */, 142 | D135E3E5DD9954EAA1E63532 /* Pods-QiniuDownloadSDK-OSXTests.debug.xcconfig */, 143 | 8EB66AD9CD931F49EBD4563D /* Pods-QiniuDownloadSDK-OSXTests.release.xcconfig */, 144 | 9DEFC1D5C1C7AEB01EE66310 /* Pods-QiniuDownloadSDKTests.debug.xcconfig */, 145 | 607448C099777063F81EE418 /* Pods-QiniuDownloadSDKTests.release.xcconfig */, 146 | ); 147 | name = Pods; 148 | sourceTree = ""; 149 | }; 150 | BAF8E8D91BD4DD9A00F63299 = { 151 | isa = PBXGroup; 152 | children = ( 153 | BAF8E8E41BD4DD9A00F63299 /* QiniuDownloadSDK */, 154 | BAF8E8F31BD4DDE400F63299 /* QiniuDownloadSDKTests */, 155 | BAF8E8E31BD4DD9A00F63299 /* Products */, 156 | 3FD1F6660EEB0B887F759377 /* Pods */, 157 | E2DECB12AE76EBD93DDE58B6 /* Frameworks */, 158 | ); 159 | sourceTree = ""; 160 | }; 161 | BAF8E8E31BD4DD9A00F63299 /* Products */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | BAF8E8E21BD4DD9A00F63299 /* libQiniuDownloadSDK.a */, 165 | BAF8E8F21BD4DDE400F63299 /* QiniuDownloadSDKTests.xctest */, 166 | BAF8E9011BD4DE0C00F63299 /* libQiniuDownloadSDK-OSX.dylib */, 167 | BAF8E90E1BD4DE2000F63299 /* QiniuDownloadSDK-OSXTests.xctest */, 168 | ); 169 | name = Products; 170 | sourceTree = ""; 171 | }; 172 | BAF8E8E41BD4DD9A00F63299 /* QiniuDownloadSDK */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | BAF8E91D1BD4DEAE00F63299 /* QNAsyncRun.h */, 176 | BAF8E91E1BD4DEAE00F63299 /* QNAsyncRun.m */, 177 | BAF8E91F1BD4DEAE00F63299 /* QNDownloadTask.h */, 178 | BAF8E9201BD4DEAE00F63299 /* QNDownloadTask.m */, 179 | BAF8E9211BD4DEAE00F63299 /* QNStats.h */, 180 | BAF8E9221BD4DEAE00F63299 /* QNDownloadManager.h */, 181 | BAF8E9231BD4DEAE00F63299 /* QNStats.m */, 182 | BAF8E9241BD4DEAE00F63299 /* QNConfig.h */, 183 | BAF8E9251BD4DEAE00F63299 /* QNConfig.m */, 184 | BAF8E9261BD4DEAE00F63299 /* QNDownloadManager.m */, 185 | BAD6BEF11BD543D100370C48 /* QiniuDownload.h */, 186 | ); 187 | path = QiniuDownloadSDK; 188 | sourceTree = ""; 189 | }; 190 | BAF8E8F31BD4DDE400F63299 /* QiniuDownloadSDKTests */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | BAF8E8F41BD4DDE400F63299 /* QiniuDownloadSDKTests.m */, 194 | BAF8E8F61BD4DDE400F63299 /* Info.plist */, 195 | ); 196 | path = QiniuDownloadSDKTests; 197 | sourceTree = ""; 198 | }; 199 | E2DECB12AE76EBD93DDE58B6 /* Frameworks */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | 3EAC2585A983350749BF0F2C /* libPods-QiniuDownloadSDK.a */, 203 | 5C90540F10FE1A810EA5A737 /* libPods-QiniuDownloadSDK-OSX.a */, 204 | F8557EDA611A5FEC44A1EEFD /* libPods-QiniuDownloadSDK-OSXTests.a */, 205 | ECB2046E96438B5541F6369C /* libPods-QiniuDownloadSDKTests.a */, 206 | ); 207 | name = Frameworks; 208 | sourceTree = ""; 209 | }; 210 | /* End PBXGroup section */ 211 | 212 | /* Begin PBXHeadersBuildPhase section */ 213 | BAF8E8FF1BD4DE0C00F63299 /* Headers */ = { 214 | isa = PBXHeadersBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | BAF8E92A1BD4DEAE00F63299 /* QNDownloadTask.h in Headers */, 218 | BAD6BEF21BD543D100370C48 /* QiniuDownload.h in Headers */, 219 | BAF8E9271BD4DEAE00F63299 /* QNAsyncRun.h in Headers */, 220 | BAF8E9311BD4DEAE00F63299 /* QNConfig.h in Headers */, 221 | BAF8E92D1BD4DEAE00F63299 /* QNStats.h in Headers */, 222 | BAF8E92E1BD4DEAE00F63299 /* QNDownloadManager.h in Headers */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | /* End PBXHeadersBuildPhase section */ 227 | 228 | /* Begin PBXNativeTarget section */ 229 | BAF8E8E11BD4DD9A00F63299 /* QiniuDownloadSDK */ = { 230 | isa = PBXNativeTarget; 231 | buildConfigurationList = BAF8E8EB1BD4DD9A00F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDK" */; 232 | buildPhases = ( 233 | D2B09EF2EC2600AD28195209 /* Check Pods Manifest.lock */, 234 | BAF8E8DE1BD4DD9A00F63299 /* Sources */, 235 | BAF8E8DF1BD4DD9A00F63299 /* Frameworks */, 236 | BAF8E8E01BD4DD9A00F63299 /* CopyFiles */, 237 | D7232A54DD68A6EFCD2F904F /* Copy Pods Resources */, 238 | ); 239 | buildRules = ( 240 | ); 241 | dependencies = ( 242 | ); 243 | name = QiniuDownloadSDK; 244 | productName = QiniuDownloadSDK; 245 | productReference = BAF8E8E21BD4DD9A00F63299 /* libQiniuDownloadSDK.a */; 246 | productType = "com.apple.product-type.library.static"; 247 | }; 248 | BAF8E8F11BD4DDE400F63299 /* QiniuDownloadSDKTests */ = { 249 | isa = PBXNativeTarget; 250 | buildConfigurationList = BAF8E8FA1BD4DDE400F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDKTests" */; 251 | buildPhases = ( 252 | 9D7E238A5A40B36A4A00183E /* Check Pods Manifest.lock */, 253 | BAF8E8EE1BD4DDE400F63299 /* Sources */, 254 | BAF8E8EF1BD4DDE400F63299 /* Frameworks */, 255 | BAF8E8F01BD4DDE400F63299 /* Resources */, 256 | 5A441EE81426036C826A3682 /* Copy Pods Resources */, 257 | ); 258 | buildRules = ( 259 | ); 260 | dependencies = ( 261 | BAF8E8F91BD4DDE400F63299 /* PBXTargetDependency */, 262 | ); 263 | name = QiniuDownloadSDKTests; 264 | productName = QiniuDownloadSDKTests; 265 | productReference = BAF8E8F21BD4DDE400F63299 /* QiniuDownloadSDKTests.xctest */; 266 | productType = "com.apple.product-type.bundle.unit-test"; 267 | }; 268 | BAF8E9001BD4DE0C00F63299 /* QiniuDownloadSDK-OSX */ = { 269 | isa = PBXNativeTarget; 270 | buildConfigurationList = BAF8E9071BD4DE0C00F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDK-OSX" */; 271 | buildPhases = ( 272 | 8F7027596E0E70DF2D71BD4E /* Check Pods Manifest.lock */, 273 | BAF8E8FD1BD4DE0C00F63299 /* Sources */, 274 | BAF8E8FE1BD4DE0C00F63299 /* Frameworks */, 275 | BAF8E8FF1BD4DE0C00F63299 /* Headers */, 276 | 4998A2507DB628D9986BA759 /* Copy Pods Resources */, 277 | ); 278 | buildRules = ( 279 | ); 280 | dependencies = ( 281 | ); 282 | name = "QiniuDownloadSDK-OSX"; 283 | productName = "QiniuDownloadSDK-OSX"; 284 | productReference = BAF8E9011BD4DE0C00F63299 /* libQiniuDownloadSDK-OSX.dylib */; 285 | productType = "com.apple.product-type.library.dynamic"; 286 | }; 287 | BAF8E90D1BD4DE2000F63299 /* QiniuDownloadSDK-OSXTests */ = { 288 | isa = PBXNativeTarget; 289 | buildConfigurationList = BAF8E9161BD4DE2000F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDK-OSXTests" */; 290 | buildPhases = ( 291 | 3F32DE230A35CC3B46440AD1 /* Check Pods Manifest.lock */, 292 | BAF8E90A1BD4DE2000F63299 /* Sources */, 293 | BAF8E90B1BD4DE2000F63299 /* Frameworks */, 294 | BAF8E90C1BD4DE2000F63299 /* Resources */, 295 | 1066009CFCD3354573690856 /* Copy Pods Resources */, 296 | ); 297 | buildRules = ( 298 | ); 299 | dependencies = ( 300 | BAF8E9151BD4DE2000F63299 /* PBXTargetDependency */, 301 | ); 302 | name = "QiniuDownloadSDK-OSXTests"; 303 | productName = "QiniuDownloadSDK-OSXTests"; 304 | productReference = BAF8E90E1BD4DE2000F63299 /* QiniuDownloadSDK-OSXTests.xctest */; 305 | productType = "com.apple.product-type.bundle.unit-test"; 306 | }; 307 | /* End PBXNativeTarget section */ 308 | 309 | /* Begin PBXProject section */ 310 | BAF8E8DA1BD4DD9A00F63299 /* Project object */ = { 311 | isa = PBXProject; 312 | attributes = { 313 | LastUpgradeCheck = 0700; 314 | ORGANIZATIONNAME = Qiniu; 315 | TargetAttributes = { 316 | BAF8E8E11BD4DD9A00F63299 = { 317 | CreatedOnToolsVersion = 7.0.1; 318 | }; 319 | BAF8E8F11BD4DDE400F63299 = { 320 | CreatedOnToolsVersion = 7.0.1; 321 | }; 322 | BAF8E9001BD4DE0C00F63299 = { 323 | CreatedOnToolsVersion = 7.0.1; 324 | }; 325 | BAF8E90D1BD4DE2000F63299 = { 326 | CreatedOnToolsVersion = 7.0.1; 327 | }; 328 | }; 329 | }; 330 | buildConfigurationList = BAF8E8DD1BD4DD9A00F63299 /* Build configuration list for PBXProject "QiniuDownloadSDK" */; 331 | compatibilityVersion = "Xcode 3.2"; 332 | developmentRegion = English; 333 | hasScannedForEncodings = 0; 334 | knownRegions = ( 335 | en, 336 | ); 337 | mainGroup = BAF8E8D91BD4DD9A00F63299; 338 | productRefGroup = BAF8E8E31BD4DD9A00F63299 /* Products */; 339 | projectDirPath = ""; 340 | projectRoot = ""; 341 | targets = ( 342 | BAF8E8E11BD4DD9A00F63299 /* QiniuDownloadSDK */, 343 | BAF8E8F11BD4DDE400F63299 /* QiniuDownloadSDKTests */, 344 | BAF8E9001BD4DE0C00F63299 /* QiniuDownloadSDK-OSX */, 345 | BAF8E90D1BD4DE2000F63299 /* QiniuDownloadSDK-OSXTests */, 346 | ); 347 | }; 348 | /* End PBXProject section */ 349 | 350 | /* Begin PBXResourcesBuildPhase section */ 351 | BAF8E8F01BD4DDE400F63299 /* Resources */ = { 352 | isa = PBXResourcesBuildPhase; 353 | buildActionMask = 2147483647; 354 | files = ( 355 | ); 356 | runOnlyForDeploymentPostprocessing = 0; 357 | }; 358 | BAF8E90C1BD4DE2000F63299 /* Resources */ = { 359 | isa = PBXResourcesBuildPhase; 360 | buildActionMask = 2147483647; 361 | files = ( 362 | ); 363 | runOnlyForDeploymentPostprocessing = 0; 364 | }; 365 | /* End PBXResourcesBuildPhase section */ 366 | 367 | /* Begin PBXShellScriptBuildPhase section */ 368 | 1066009CFCD3354573690856 /* Copy Pods Resources */ = { 369 | isa = PBXShellScriptBuildPhase; 370 | buildActionMask = 2147483647; 371 | files = ( 372 | ); 373 | inputPaths = ( 374 | ); 375 | name = "Copy Pods Resources"; 376 | outputPaths = ( 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | shellPath = /bin/sh; 380 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QiniuDownloadSDK-OSXTests/Pods-QiniuDownloadSDK-OSXTests-resources.sh\"\n"; 381 | showEnvVarsInLog = 0; 382 | }; 383 | 3F32DE230A35CC3B46440AD1 /* Check Pods Manifest.lock */ = { 384 | isa = PBXShellScriptBuildPhase; 385 | buildActionMask = 2147483647; 386 | files = ( 387 | ); 388 | inputPaths = ( 389 | ); 390 | name = "Check Pods Manifest.lock"; 391 | outputPaths = ( 392 | ); 393 | runOnlyForDeploymentPostprocessing = 0; 394 | shellPath = /bin/sh; 395 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 396 | showEnvVarsInLog = 0; 397 | }; 398 | 4998A2507DB628D9986BA759 /* Copy Pods Resources */ = { 399 | isa = PBXShellScriptBuildPhase; 400 | buildActionMask = 2147483647; 401 | files = ( 402 | ); 403 | inputPaths = ( 404 | ); 405 | name = "Copy Pods Resources"; 406 | outputPaths = ( 407 | ); 408 | runOnlyForDeploymentPostprocessing = 0; 409 | shellPath = /bin/sh; 410 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QiniuDownloadSDK-OSX/Pods-QiniuDownloadSDK-OSX-resources.sh\"\n"; 411 | showEnvVarsInLog = 0; 412 | }; 413 | 5A441EE81426036C826A3682 /* Copy Pods Resources */ = { 414 | isa = PBXShellScriptBuildPhase; 415 | buildActionMask = 2147483647; 416 | files = ( 417 | ); 418 | inputPaths = ( 419 | ); 420 | name = "Copy Pods Resources"; 421 | outputPaths = ( 422 | ); 423 | runOnlyForDeploymentPostprocessing = 0; 424 | shellPath = /bin/sh; 425 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QiniuDownloadSDKTests/Pods-QiniuDownloadSDKTests-resources.sh\"\n"; 426 | showEnvVarsInLog = 0; 427 | }; 428 | 8F7027596E0E70DF2D71BD4E /* Check Pods Manifest.lock */ = { 429 | isa = PBXShellScriptBuildPhase; 430 | buildActionMask = 2147483647; 431 | files = ( 432 | ); 433 | inputPaths = ( 434 | ); 435 | name = "Check Pods Manifest.lock"; 436 | outputPaths = ( 437 | ); 438 | runOnlyForDeploymentPostprocessing = 0; 439 | shellPath = /bin/sh; 440 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 441 | showEnvVarsInLog = 0; 442 | }; 443 | 9D7E238A5A40B36A4A00183E /* Check Pods Manifest.lock */ = { 444 | isa = PBXShellScriptBuildPhase; 445 | buildActionMask = 2147483647; 446 | files = ( 447 | ); 448 | inputPaths = ( 449 | ); 450 | name = "Check Pods Manifest.lock"; 451 | outputPaths = ( 452 | ); 453 | runOnlyForDeploymentPostprocessing = 0; 454 | shellPath = /bin/sh; 455 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 456 | showEnvVarsInLog = 0; 457 | }; 458 | D2B09EF2EC2600AD28195209 /* Check Pods Manifest.lock */ = { 459 | isa = PBXShellScriptBuildPhase; 460 | buildActionMask = 2147483647; 461 | files = ( 462 | ); 463 | inputPaths = ( 464 | ); 465 | name = "Check Pods Manifest.lock"; 466 | outputPaths = ( 467 | ); 468 | runOnlyForDeploymentPostprocessing = 0; 469 | shellPath = /bin/sh; 470 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 471 | showEnvVarsInLog = 0; 472 | }; 473 | D7232A54DD68A6EFCD2F904F /* Copy Pods Resources */ = { 474 | isa = PBXShellScriptBuildPhase; 475 | buildActionMask = 2147483647; 476 | files = ( 477 | ); 478 | inputPaths = ( 479 | ); 480 | name = "Copy Pods Resources"; 481 | outputPaths = ( 482 | ); 483 | runOnlyForDeploymentPostprocessing = 0; 484 | shellPath = /bin/sh; 485 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QiniuDownloadSDK/Pods-QiniuDownloadSDK-resources.sh\"\n"; 486 | showEnvVarsInLog = 0; 487 | }; 488 | /* End PBXShellScriptBuildPhase section */ 489 | 490 | /* Begin PBXSourcesBuildPhase section */ 491 | BAF8E8DE1BD4DD9A00F63299 /* Sources */ = { 492 | isa = PBXSourcesBuildPhase; 493 | buildActionMask = 2147483647; 494 | files = ( 495 | BAF8E92F1BD4DEAE00F63299 /* QNStats.m in Sources */, 496 | BAF8E9281BD4DEAE00F63299 /* QNAsyncRun.m in Sources */, 497 | BAF8E9341BD4DEAE00F63299 /* QNDownloadManager.m in Sources */, 498 | BAF8E9321BD4DEAE00F63299 /* QNConfig.m in Sources */, 499 | BAF8E92B1BD4DEAE00F63299 /* QNDownloadTask.m in Sources */, 500 | ); 501 | runOnlyForDeploymentPostprocessing = 0; 502 | }; 503 | BAF8E8EE1BD4DDE400F63299 /* Sources */ = { 504 | isa = PBXSourcesBuildPhase; 505 | buildActionMask = 2147483647; 506 | files = ( 507 | BAF8E8F51BD4DDE400F63299 /* QiniuDownloadSDKTests.m in Sources */, 508 | ); 509 | runOnlyForDeploymentPostprocessing = 0; 510 | }; 511 | BAF8E8FD1BD4DE0C00F63299 /* Sources */ = { 512 | isa = PBXSourcesBuildPhase; 513 | buildActionMask = 2147483647; 514 | files = ( 515 | BAF8E9291BD4DEAE00F63299 /* QNAsyncRun.m in Sources */, 516 | BAF8E9351BD4DEAE00F63299 /* QNDownloadManager.m in Sources */, 517 | BAF8E92C1BD4DEAE00F63299 /* QNDownloadTask.m in Sources */, 518 | BAF8E9331BD4DEAE00F63299 /* QNConfig.m in Sources */, 519 | BAF8E9301BD4DEAE00F63299 /* QNStats.m in Sources */, 520 | ); 521 | runOnlyForDeploymentPostprocessing = 0; 522 | }; 523 | BAF8E90A1BD4DE2000F63299 /* Sources */ = { 524 | isa = PBXSourcesBuildPhase; 525 | buildActionMask = 2147483647; 526 | files = ( 527 | BAD6BEED1BD4EC5600370C48 /* QiniuDownloadSDKTests.m in Sources */, 528 | ); 529 | runOnlyForDeploymentPostprocessing = 0; 530 | }; 531 | /* End PBXSourcesBuildPhase section */ 532 | 533 | /* Begin PBXTargetDependency section */ 534 | BAF8E8F91BD4DDE400F63299 /* PBXTargetDependency */ = { 535 | isa = PBXTargetDependency; 536 | target = BAF8E8E11BD4DD9A00F63299 /* QiniuDownloadSDK */; 537 | targetProxy = BAF8E8F81BD4DDE400F63299 /* PBXContainerItemProxy */; 538 | }; 539 | BAF8E9151BD4DE2000F63299 /* PBXTargetDependency */ = { 540 | isa = PBXTargetDependency; 541 | target = BAF8E9001BD4DE0C00F63299 /* QiniuDownloadSDK-OSX */; 542 | targetProxy = BAF8E9141BD4DE2000F63299 /* PBXContainerItemProxy */; 543 | }; 544 | /* End PBXTargetDependency section */ 545 | 546 | /* Begin XCBuildConfiguration section */ 547 | BAF8E8E91BD4DD9A00F63299 /* Debug */ = { 548 | isa = XCBuildConfiguration; 549 | buildSettings = { 550 | ALWAYS_SEARCH_USER_PATHS = NO; 551 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 552 | CLANG_CXX_LIBRARY = "libc++"; 553 | CLANG_ENABLE_MODULES = YES; 554 | CLANG_ENABLE_OBJC_ARC = YES; 555 | CLANG_WARN_BOOL_CONVERSION = YES; 556 | CLANG_WARN_CONSTANT_CONVERSION = YES; 557 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 558 | CLANG_WARN_EMPTY_BODY = YES; 559 | CLANG_WARN_ENUM_CONVERSION = YES; 560 | CLANG_WARN_INT_CONVERSION = YES; 561 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 562 | CLANG_WARN_UNREACHABLE_CODE = YES; 563 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 564 | COPY_PHASE_STRIP = NO; 565 | DEBUG_INFORMATION_FORMAT = dwarf; 566 | ENABLE_STRICT_OBJC_MSGSEND = YES; 567 | ENABLE_TESTABILITY = YES; 568 | GCC_C_LANGUAGE_STANDARD = gnu99; 569 | GCC_DYNAMIC_NO_PIC = NO; 570 | GCC_NO_COMMON_BLOCKS = YES; 571 | GCC_OPTIMIZATION_LEVEL = 0; 572 | GCC_PREPROCESSOR_DEFINITIONS = ( 573 | "DEBUG=1", 574 | "$(inherited)", 575 | ); 576 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 577 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 578 | GCC_WARN_UNDECLARED_SELECTOR = YES; 579 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 580 | GCC_WARN_UNUSED_FUNCTION = YES; 581 | GCC_WARN_UNUSED_VARIABLE = YES; 582 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 583 | MTL_ENABLE_DEBUG_INFO = YES; 584 | ONLY_ACTIVE_ARCH = YES; 585 | SDKROOT = iphoneos; 586 | }; 587 | name = Debug; 588 | }; 589 | BAF8E8EA1BD4DD9A00F63299 /* Release */ = { 590 | isa = XCBuildConfiguration; 591 | buildSettings = { 592 | ALWAYS_SEARCH_USER_PATHS = NO; 593 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 594 | CLANG_CXX_LIBRARY = "libc++"; 595 | CLANG_ENABLE_MODULES = YES; 596 | CLANG_ENABLE_OBJC_ARC = YES; 597 | CLANG_WARN_BOOL_CONVERSION = YES; 598 | CLANG_WARN_CONSTANT_CONVERSION = YES; 599 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 600 | CLANG_WARN_EMPTY_BODY = YES; 601 | CLANG_WARN_ENUM_CONVERSION = YES; 602 | CLANG_WARN_INT_CONVERSION = YES; 603 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 604 | CLANG_WARN_UNREACHABLE_CODE = YES; 605 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 606 | COPY_PHASE_STRIP = NO; 607 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 608 | ENABLE_NS_ASSERTIONS = NO; 609 | ENABLE_STRICT_OBJC_MSGSEND = YES; 610 | GCC_C_LANGUAGE_STANDARD = gnu99; 611 | GCC_NO_COMMON_BLOCKS = YES; 612 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 613 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 614 | GCC_WARN_UNDECLARED_SELECTOR = YES; 615 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 616 | GCC_WARN_UNUSED_FUNCTION = YES; 617 | GCC_WARN_UNUSED_VARIABLE = YES; 618 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 619 | MTL_ENABLE_DEBUG_INFO = NO; 620 | SDKROOT = iphoneos; 621 | VALIDATE_PRODUCT = YES; 622 | }; 623 | name = Release; 624 | }; 625 | BAF8E8EC1BD4DD9A00F63299 /* Debug */ = { 626 | isa = XCBuildConfiguration; 627 | baseConfigurationReference = 06A65219A9113B4A57F53083 /* Pods-QiniuDownloadSDK.debug.xcconfig */; 628 | buildSettings = { 629 | OTHER_LDFLAGS = "-ObjC"; 630 | PRODUCT_NAME = "$(TARGET_NAME)"; 631 | SKIP_INSTALL = YES; 632 | }; 633 | name = Debug; 634 | }; 635 | BAF8E8ED1BD4DD9A00F63299 /* Release */ = { 636 | isa = XCBuildConfiguration; 637 | baseConfigurationReference = 935913027F332B0DD9FD7B3B /* Pods-QiniuDownloadSDK.release.xcconfig */; 638 | buildSettings = { 639 | OTHER_LDFLAGS = "-ObjC"; 640 | PRODUCT_NAME = "$(TARGET_NAME)"; 641 | SKIP_INSTALL = YES; 642 | }; 643 | name = Release; 644 | }; 645 | BAF8E8FB1BD4DDE400F63299 /* Debug */ = { 646 | isa = XCBuildConfiguration; 647 | baseConfigurationReference = 9DEFC1D5C1C7AEB01EE66310 /* Pods-QiniuDownloadSDKTests.debug.xcconfig */; 648 | buildSettings = { 649 | INFOPLIST_FILE = QiniuDownloadSDKTests/Info.plist; 650 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 651 | PRODUCT_BUNDLE_IDENTIFIER = Qiniu.QiniuDownloadSDKTests; 652 | PRODUCT_NAME = "$(TARGET_NAME)"; 653 | }; 654 | name = Debug; 655 | }; 656 | BAF8E8FC1BD4DDE400F63299 /* Release */ = { 657 | isa = XCBuildConfiguration; 658 | baseConfigurationReference = 607448C099777063F81EE418 /* Pods-QiniuDownloadSDKTests.release.xcconfig */; 659 | buildSettings = { 660 | INFOPLIST_FILE = QiniuDownloadSDKTests/Info.plist; 661 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 662 | PRODUCT_BUNDLE_IDENTIFIER = Qiniu.QiniuDownloadSDKTests; 663 | PRODUCT_NAME = "$(TARGET_NAME)"; 664 | }; 665 | name = Release; 666 | }; 667 | BAF8E9081BD4DE0C00F63299 /* Debug */ = { 668 | isa = XCBuildConfiguration; 669 | baseConfigurationReference = E3820CA9BBF98C2B8EBFC3E4 /* Pods-QiniuDownloadSDK-OSX.debug.xcconfig */; 670 | buildSettings = { 671 | DYLIB_COMPATIBILITY_VERSION = 1; 672 | DYLIB_CURRENT_VERSION = 1; 673 | EXECUTABLE_PREFIX = lib; 674 | MACOSX_DEPLOYMENT_TARGET = 10.10; 675 | PRODUCT_NAME = "$(TARGET_NAME)"; 676 | SDKROOT = macosx; 677 | }; 678 | name = Debug; 679 | }; 680 | BAF8E9091BD4DE0C00F63299 /* Release */ = { 681 | isa = XCBuildConfiguration; 682 | baseConfigurationReference = 7E9494AD1FB8EC51AB1E4850 /* Pods-QiniuDownloadSDK-OSX.release.xcconfig */; 683 | buildSettings = { 684 | DYLIB_COMPATIBILITY_VERSION = 1; 685 | DYLIB_CURRENT_VERSION = 1; 686 | EXECUTABLE_PREFIX = lib; 687 | MACOSX_DEPLOYMENT_TARGET = 10.10; 688 | PRODUCT_NAME = "$(TARGET_NAME)"; 689 | SDKROOT = macosx; 690 | }; 691 | name = Release; 692 | }; 693 | BAF8E9171BD4DE2000F63299 /* Debug */ = { 694 | isa = XCBuildConfiguration; 695 | baseConfigurationReference = D135E3E5DD9954EAA1E63532 /* Pods-QiniuDownloadSDK-OSXTests.debug.xcconfig */; 696 | buildSettings = { 697 | COMBINE_HIDPI_IMAGES = YES; 698 | INFOPLIST_FILE = QiniuDownloadSDKTests/Info.plist; 699 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 700 | MACOSX_DEPLOYMENT_TARGET = 10.10; 701 | PRODUCT_BUNDLE_IDENTIFIER = "Qiniu.QiniuDownloadSDK-OSXTests"; 702 | PRODUCT_NAME = "$(TARGET_NAME)"; 703 | SDKROOT = macosx; 704 | }; 705 | name = Debug; 706 | }; 707 | BAF8E9181BD4DE2000F63299 /* Release */ = { 708 | isa = XCBuildConfiguration; 709 | baseConfigurationReference = 8EB66AD9CD931F49EBD4563D /* Pods-QiniuDownloadSDK-OSXTests.release.xcconfig */; 710 | buildSettings = { 711 | COMBINE_HIDPI_IMAGES = YES; 712 | INFOPLIST_FILE = QiniuDownloadSDKTests/Info.plist; 713 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 714 | MACOSX_DEPLOYMENT_TARGET = 10.10; 715 | PRODUCT_BUNDLE_IDENTIFIER = "Qiniu.QiniuDownloadSDK-OSXTests"; 716 | PRODUCT_NAME = "$(TARGET_NAME)"; 717 | SDKROOT = macosx; 718 | }; 719 | name = Release; 720 | }; 721 | /* End XCBuildConfiguration section */ 722 | 723 | /* Begin XCConfigurationList section */ 724 | BAF8E8DD1BD4DD9A00F63299 /* Build configuration list for PBXProject "QiniuDownloadSDK" */ = { 725 | isa = XCConfigurationList; 726 | buildConfigurations = ( 727 | BAF8E8E91BD4DD9A00F63299 /* Debug */, 728 | BAF8E8EA1BD4DD9A00F63299 /* Release */, 729 | ); 730 | defaultConfigurationIsVisible = 0; 731 | defaultConfigurationName = Release; 732 | }; 733 | BAF8E8EB1BD4DD9A00F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDK" */ = { 734 | isa = XCConfigurationList; 735 | buildConfigurations = ( 736 | BAF8E8EC1BD4DD9A00F63299 /* Debug */, 737 | BAF8E8ED1BD4DD9A00F63299 /* Release */, 738 | ); 739 | defaultConfigurationIsVisible = 0; 740 | defaultConfigurationName = Release; 741 | }; 742 | BAF8E8FA1BD4DDE400F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDKTests" */ = { 743 | isa = XCConfigurationList; 744 | buildConfigurations = ( 745 | BAF8E8FB1BD4DDE400F63299 /* Debug */, 746 | BAF8E8FC1BD4DDE400F63299 /* Release */, 747 | ); 748 | defaultConfigurationIsVisible = 0; 749 | defaultConfigurationName = Release; 750 | }; 751 | BAF8E9071BD4DE0C00F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDK-OSX" */ = { 752 | isa = XCConfigurationList; 753 | buildConfigurations = ( 754 | BAF8E9081BD4DE0C00F63299 /* Debug */, 755 | BAF8E9091BD4DE0C00F63299 /* Release */, 756 | ); 757 | defaultConfigurationIsVisible = 0; 758 | defaultConfigurationName = Release; 759 | }; 760 | BAF8E9161BD4DE2000F63299 /* Build configuration list for PBXNativeTarget "QiniuDownloadSDK-OSXTests" */ = { 761 | isa = XCConfigurationList; 762 | buildConfigurations = ( 763 | BAF8E9171BD4DE2000F63299 /* Debug */, 764 | BAF8E9181BD4DE2000F63299 /* Release */, 765 | ); 766 | defaultConfigurationIsVisible = 0; 767 | defaultConfigurationName = Release; 768 | }; 769 | /* End XCConfigurationList section */ 770 | }; 771 | rootObject = BAF8E8DA1BD4DD9A00F63299 /* Project object */; 772 | } 773 | -------------------------------------------------------------------------------- /uncrustify.cfg: -------------------------------------------------------------------------------- 1 | # Uncrustify 0.61 2 | 3 | # 4 | # General options 5 | # 6 | 7 | # The type of line endings 8 | newlines = auto # auto/lf/crlf/cr 9 | 10 | # The original size of tabs in the input 11 | input_tab_size = 8 # number 12 | 13 | # The size of tabs in the output (only used if align_with_tabs=true) 14 | output_tab_size = 8 # number 15 | 16 | # The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn) 17 | string_escape_char = 92 # number 18 | 19 | # Alternate string escape char for Pawn. Only works right before the quote char. 20 | string_escape_char2 = 0 # number 21 | 22 | # Allow interpreting '>=' and '>>=' as part of a template in 'void f(list>=val);'. 23 | # If true (default), 'assert(x<0 && y>=3)' will be broken. 24 | # Improvements to template detection may make this option obsolete. 25 | tok_split_gte = false # false/true 26 | 27 | # Control what to do with the UTF-8 BOM (recommend 'remove') 28 | utf8_bom = ignore # ignore/add/remove/force 29 | 30 | # If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8 31 | utf8_byte = false # false/true 32 | 33 | # Force the output encoding to UTF-8 34 | utf8_force = false # false/true 35 | 36 | # 37 | # Indenting 38 | # 39 | 40 | # The number of columns to indent per level. 41 | # Usually 2, 3, 4, or 8. 42 | indent_columns = 8 # number 43 | 44 | # The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents. 45 | # For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level 46 | indent_continue = 0 # number 47 | 48 | # How to use tabs when indenting code 49 | # 0=spaces only 50 | # 1=indent with tabs to brace level, align with spaces 51 | # 2=indent and align with tabs, using spaces when not on a tabstop 52 | indent_with_tabs = 1 # number 53 | 54 | # Comments that are not a brace level are indented with tabs on a tabstop. 55 | # Requires indent_with_tabs=2. If false, will use spaces. 56 | indent_cmt_with_tabs = false # false/true 57 | 58 | # Whether to indent strings broken by '\' so that they line up 59 | indent_align_string = false # false/true 60 | 61 | # The number of spaces to indent multi-line XML strings. 62 | # Requires indent_align_string=True 63 | indent_xml_string = 0 # number 64 | 65 | # Spaces to indent '{' from level 66 | indent_brace = 0 # number 67 | 68 | # Whether braces are indented to the body level 69 | indent_braces = false # false/true 70 | 71 | # Disabled indenting function braces if indent_braces is true 72 | indent_braces_no_func = false # false/true 73 | 74 | # Disabled indenting class braces if indent_braces is true 75 | indent_braces_no_class = false # false/true 76 | 77 | # Disabled indenting struct braces if indent_braces is true 78 | indent_braces_no_struct = false # false/true 79 | 80 | # Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. 81 | indent_brace_parent = false # false/true 82 | 83 | # Indent based on the paren open instead of the brace open in '({\n', default is to indent by brace. 84 | indent_paren_open_brace = false # false/true 85 | 86 | # Whether the 'namespace' body is indented 87 | indent_namespace = false # false/true 88 | 89 | # Only indent one namespace and no sub-namepaces. 90 | # Requires indent_namespace=true. 91 | indent_namespace_single_indent = false # false/true 92 | 93 | # The number of spaces to indent a namespace block 94 | indent_namespace_level = 0 # number 95 | 96 | # If the body of the namespace is longer than this number, it won't be indented. 97 | # Requires indent_namespace=true. Default=0 (no limit) 98 | indent_namespace_limit = 0 # number 99 | 100 | # Whether the 'extern "C"' body is indented 101 | indent_extern = false # false/true 102 | 103 | # Whether the 'class' body is indented 104 | indent_class = false # false/true 105 | 106 | # Whether to indent the stuff after a leading base class colon 107 | indent_class_colon = false # false/true 108 | 109 | # Whether to indent the stuff after a leading class initializer colon 110 | indent_constr_colon = false # false/true 111 | 112 | # Virtual indent from the ':' for member initializers. Default is 2 113 | indent_ctor_init_leading = 2 # number 114 | 115 | # Additional indenting for constructor initializer list 116 | indent_ctor_init = 0 # number 117 | 118 | # False=treat 'else\nif' as 'else if' for indenting purposes 119 | # True=indent the 'if' one level 120 | indent_else_if = false # false/true 121 | 122 | # Amount to indent variable declarations after a open brace. neg=relative, pos=absolute 123 | indent_var_def_blk = 0 # number 124 | 125 | # Indent continued variable declarations instead of aligning. 126 | indent_var_def_cont = false # false/true 127 | 128 | # True: force indentation of function definition to start in column 1 129 | # False: use the default behavior 130 | indent_func_def_force_col1 = false # false/true 131 | 132 | # True: indent continued function call parameters one indent level 133 | # False: align parameters under the open paren 134 | indent_func_call_param = false # false/true 135 | 136 | # Same as indent_func_call_param, but for function defs 137 | indent_func_def_param = false # false/true 138 | 139 | # Same as indent_func_call_param, but for function protos 140 | indent_func_proto_param = false # false/true 141 | 142 | # Same as indent_func_call_param, but for class declarations 143 | indent_func_class_param = false # false/true 144 | 145 | # Same as indent_func_call_param, but for class variable constructors 146 | indent_func_ctor_var_param = false # false/true 147 | 148 | # Same as indent_func_call_param, but for templates 149 | indent_template_param = false # false/true 150 | 151 | # Double the indent for indent_func_xxx_param options 152 | indent_func_param_double = false # false/true 153 | 154 | # Indentation column for standalone 'const' function decl/proto qualifier 155 | indent_func_const = 0 # number 156 | 157 | # Indentation column for standalone 'throw' function decl/proto qualifier 158 | indent_func_throw = 0 # number 159 | 160 | # The number of spaces to indent a continued '->' or '.' 161 | # Usually set to 0, 1, or indent_columns. 162 | indent_member = 0 # number 163 | 164 | # Spaces to indent single line ('//') comments on lines before code 165 | indent_sing_line_comments = 0 # number 166 | 167 | # If set, will indent trailing single line ('//') comments relative 168 | # to the code instead of trying to keep the same absolute column 169 | indent_relative_single_line_comments = false # false/true 170 | 171 | # Spaces to indent 'case' from 'switch' 172 | # Usually 0 or indent_columns. 173 | indent_switch_case = 0 # number 174 | 175 | # Spaces to shift the 'case' line, without affecting any other lines 176 | # Usually 0. 177 | indent_case_shift = 0 # number 178 | 179 | # Spaces to indent '{' from 'case'. 180 | # By default, the brace will appear under the 'c' in case. 181 | # Usually set to 0 or indent_columns. 182 | indent_case_brace = 0 # number 183 | 184 | # Whether to indent comments found in first column 185 | indent_col1_comment = false # false/true 186 | 187 | # How to indent goto labels 188 | # >0 : absolute column where 1 is the leftmost column 189 | # <=0 : subtract from brace indent 190 | indent_label = 1 # number 191 | 192 | # Same as indent_label, but for access specifiers that are followed by a colon 193 | indent_access_spec = 1 # number 194 | 195 | # Indent the code after an access specifier by one level. 196 | # If set, this option forces 'indent_access_spec=0' 197 | indent_access_spec_body = false # false/true 198 | 199 | # If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended) 200 | indent_paren_nl = false # false/true 201 | 202 | # Controls the indent of a close paren after a newline. 203 | # 0: Indent to body level 204 | # 1: Align under the open paren 205 | # 2: Indent to the brace level 206 | indent_paren_close = 0 # number 207 | 208 | # Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren 209 | indent_comma_paren = false # false/true 210 | 211 | # Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren 212 | indent_bool_paren = false # false/true 213 | 214 | # If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones 215 | indent_first_bool_expr = false # false/true 216 | 217 | # If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended) 218 | indent_square_nl = false # false/true 219 | 220 | # Don't change the relative indent of ESQL/C 'EXEC SQL' bodies 221 | indent_preserve_sql = false # false/true 222 | 223 | # Align continued statements at the '='. Default=True 224 | # If FALSE or the '=' is followed by a newline, the next line is indent one tab. 225 | indent_align_assign = true # false/true 226 | 227 | # Indent OC blocks at brace level instead of usual rules. 228 | indent_oc_block = false # false/true 229 | 230 | # Indent OC blocks in a message relative to the parameter name. 231 | # 0=use indent_oc_block rules, 1+=spaces to indent 232 | indent_oc_block_msg = 0 # number 233 | 234 | # Minimum indent for subsequent parameters 235 | indent_oc_msg_colon = 0 # number 236 | 237 | # If true, prioritize aligning with initial colon (and stripping spaces from lines, if necessary). 238 | # Default is true. 239 | indent_oc_msg_prioritize_first_colon = true # false/true 240 | 241 | # If indent_oc_block_msg and this option are on, blocks will be indented the way that Xcode does by default (from keyword if the parameter is on its own line; otherwise, from the previous indentation level). 242 | indent_oc_block_msg_xcode_style = false # false/true 243 | 244 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg keyword. 245 | indent_oc_block_msg_from_keyword = false # false/true 246 | 247 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg colon. 248 | indent_oc_block_msg_from_colon = false # false/true 249 | 250 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the block caret is. 251 | indent_oc_block_msg_from_caret = false # false/true 252 | 253 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is. 254 | indent_oc_block_msg_from_brace = false # false/true 255 | 256 | # 257 | # Spacing options 258 | # 259 | 260 | # Add or remove space around arithmetic operator '+', '-', '/', '*', etc 261 | sp_arith = ignore # ignore/add/remove/force 262 | 263 | # Add or remove space around assignment operator '=', '+=', etc 264 | sp_assign = ignore # ignore/add/remove/force 265 | 266 | # Add or remove space around '=' in C++11 lambda capture specifications. Overrides sp_assign 267 | sp_cpp_lambda_assign = ignore # ignore/add/remove/force 268 | 269 | # Add or remove space after the capture specification in C++11 lambda. 270 | sp_cpp_lambda_paren = ignore # ignore/add/remove/force 271 | 272 | # Add or remove space around assignment operator '=' in a prototype 273 | sp_assign_default = ignore # ignore/add/remove/force 274 | 275 | # Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. 276 | sp_before_assign = ignore # ignore/add/remove/force 277 | 278 | # Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. 279 | sp_after_assign = ignore # ignore/add/remove/force 280 | 281 | # Add or remove space in 'NS_ENUM (' 282 | sp_enum_paren = ignore # ignore/add/remove/force 283 | 284 | # Add or remove space around assignment '=' in enum 285 | sp_enum_assign = ignore # ignore/add/remove/force 286 | 287 | # Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. 288 | sp_enum_before_assign = ignore # ignore/add/remove/force 289 | 290 | # Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. 291 | sp_enum_after_assign = ignore # ignore/add/remove/force 292 | 293 | # Add or remove space around preprocessor '##' concatenation operator. Default=Add 294 | sp_pp_concat = add # ignore/add/remove/force 295 | 296 | # Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. 297 | sp_pp_stringify = ignore # ignore/add/remove/force 298 | 299 | # Add or remove space before preprocessor '#' stringify operator as in '#define x(y) L#y'. 300 | sp_before_pp_stringify = ignore # ignore/add/remove/force 301 | 302 | # Add or remove space around boolean operators '&&' and '||' 303 | sp_bool = ignore # ignore/add/remove/force 304 | 305 | # Add or remove space around compare operator '<', '>', '==', etc 306 | sp_compare = ignore # ignore/add/remove/force 307 | 308 | # Add or remove space inside '(' and ')' 309 | sp_inside_paren = ignore # ignore/add/remove/force 310 | 311 | # Add or remove space between nested parens: '((' vs ') )' 312 | sp_paren_paren = ignore # ignore/add/remove/force 313 | 314 | # Add or remove space between back-to-back parens: ')(' vs ') (' 315 | sp_cparen_oparen = ignore # ignore/add/remove/force 316 | 317 | # Whether to balance spaces inside nested parens 318 | sp_balance_nested_parens = false # false/true 319 | 320 | # Add or remove space between ')' and '{' 321 | sp_paren_brace = ignore # ignore/add/remove/force 322 | 323 | # Add or remove space before pointer star '*' 324 | sp_before_ptr_star = ignore # ignore/add/remove/force 325 | 326 | # Add or remove space before pointer star '*' that isn't followed by a variable name 327 | # If set to 'ignore', sp_before_ptr_star is used instead. 328 | sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force 329 | 330 | # Add or remove space between pointer stars '*' 331 | sp_between_ptr_star = ignore # ignore/add/remove/force 332 | 333 | # Add or remove space after pointer star '*', if followed by a word. 334 | sp_after_ptr_star = ignore # ignore/add/remove/force 335 | 336 | # Add or remove space after pointer star '*', if followed by a qualifier. 337 | sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force 338 | 339 | # Add or remove space after a pointer star '*', if followed by a func proto/def. 340 | sp_after_ptr_star_func = ignore # ignore/add/remove/force 341 | 342 | # Add or remove space after a pointer star '*', if followed by an open paren (function types). 343 | sp_ptr_star_paren = ignore # ignore/add/remove/force 344 | 345 | # Add or remove space before a pointer star '*', if followed by a func proto/def. 346 | sp_before_ptr_star_func = ignore # ignore/add/remove/force 347 | 348 | # Add or remove space before a reference sign '&' 349 | sp_before_byref = ignore # ignore/add/remove/force 350 | 351 | # Add or remove space before a reference sign '&' that isn't followed by a variable name 352 | # If set to 'ignore', sp_before_byref is used instead. 353 | sp_before_unnamed_byref = ignore # ignore/add/remove/force 354 | 355 | # Add or remove space after reference sign '&', if followed by a word. 356 | sp_after_byref = ignore # ignore/add/remove/force 357 | 358 | # Add or remove space after a reference sign '&', if followed by a func proto/def. 359 | sp_after_byref_func = ignore # ignore/add/remove/force 360 | 361 | # Add or remove space before a reference sign '&', if followed by a func proto/def. 362 | sp_before_byref_func = ignore # ignore/add/remove/force 363 | 364 | # Add or remove space between type and word. Default=Force 365 | sp_after_type = force # ignore/add/remove/force 366 | 367 | # Add or remove space before the paren in the D constructs 'template Foo(' and 'class Foo('. 368 | sp_before_template_paren = ignore # ignore/add/remove/force 369 | 370 | # Add or remove space in 'template <' vs 'template<'. 371 | # If set to ignore, sp_before_angle is used. 372 | sp_template_angle = ignore # ignore/add/remove/force 373 | 374 | # Add or remove space before '<>' 375 | sp_before_angle = ignore # ignore/add/remove/force 376 | 377 | # Add or remove space inside '<' and '>' 378 | sp_inside_angle = ignore # ignore/add/remove/force 379 | 380 | # Add or remove space after '<>' 381 | sp_after_angle = ignore # ignore/add/remove/force 382 | 383 | # Add or remove space between '<>' and '(' as found in 'new List();' 384 | sp_angle_paren = ignore # ignore/add/remove/force 385 | 386 | # Add or remove space between '<>' and a word as in 'List m;' 387 | sp_angle_word = ignore # ignore/add/remove/force 388 | 389 | # Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add 390 | sp_angle_shift = add # ignore/add/remove/force 391 | 392 | # Permit removal of the space between '>>' in 'foo >' (C++11 only). Default=False 393 | # sp_angle_shift cannot remove the space without this option. 394 | sp_permit_cpp11_shift = false # false/true 395 | 396 | # Add or remove space before '(' of 'if', 'for', 'switch', and 'while' 397 | sp_before_sparen = ignore # ignore/add/remove/force 398 | 399 | # Add or remove space inside if-condition '(' and ')' 400 | sp_inside_sparen = ignore # ignore/add/remove/force 401 | 402 | # Add or remove space before if-condition ')'. Overrides sp_inside_sparen. 403 | sp_inside_sparen_close = ignore # ignore/add/remove/force 404 | 405 | # Add or remove space before if-condition '('. Overrides sp_inside_sparen. 406 | sp_inside_sparen_open = ignore # ignore/add/remove/force 407 | 408 | # Add or remove space after ')' of 'if', 'for', 'switch', and 'while' 409 | sp_after_sparen = ignore # ignore/add/remove/force 410 | 411 | # Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while' 412 | sp_sparen_brace = ignore # ignore/add/remove/force 413 | 414 | # Add or remove space between 'invariant' and '(' in the D language. 415 | sp_invariant_paren = ignore # ignore/add/remove/force 416 | 417 | # Add or remove space after the ')' in 'invariant (C) c' in the D language. 418 | sp_after_invariant_paren = ignore # ignore/add/remove/force 419 | 420 | # Add or remove space before empty statement ';' on 'if', 'for' and 'while' 421 | sp_special_semi = ignore # ignore/add/remove/force 422 | 423 | # Add or remove space before ';'. Default=Remove 424 | sp_before_semi = remove # ignore/add/remove/force 425 | 426 | # Add or remove space before ';' in non-empty 'for' statements 427 | sp_before_semi_for = ignore # ignore/add/remove/force 428 | 429 | # Add or remove space before a semicolon of an empty part of a for statement. 430 | sp_before_semi_for_empty = ignore # ignore/add/remove/force 431 | 432 | # Add or remove space after ';', except when followed by a comment. Default=Add 433 | sp_after_semi = add # ignore/add/remove/force 434 | 435 | # Add or remove space after ';' in non-empty 'for' statements. Default=Force 436 | sp_after_semi_for = force # ignore/add/remove/force 437 | 438 | # Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; ). 439 | sp_after_semi_for_empty = ignore # ignore/add/remove/force 440 | 441 | # Add or remove space before '[' (except '[]') 442 | sp_before_square = ignore # ignore/add/remove/force 443 | 444 | # Add or remove space before '[]' 445 | sp_before_squares = ignore # ignore/add/remove/force 446 | 447 | # Add or remove space inside a non-empty '[' and ']' 448 | sp_inside_square = ignore # ignore/add/remove/force 449 | 450 | # Add or remove space after ',' 451 | sp_after_comma = ignore # ignore/add/remove/force 452 | 453 | # Add or remove space before ',' 454 | sp_before_comma = remove # ignore/add/remove/force 455 | 456 | # Add or remove space between an open paren and comma: '(,' vs '( ,' 457 | sp_paren_comma = force # ignore/add/remove/force 458 | 459 | # Add or remove space before the variadic '...' when preceded by a non-punctuator 460 | sp_before_ellipsis = ignore # ignore/add/remove/force 461 | 462 | # Add or remove space after class ':' 463 | sp_after_class_colon = ignore # ignore/add/remove/force 464 | 465 | # Add or remove space before class ':' 466 | sp_before_class_colon = ignore # ignore/add/remove/force 467 | 468 | # Add or remove space after class constructor ':' 469 | sp_after_constr_colon = ignore # ignore/add/remove/force 470 | 471 | # Add or remove space before class constructor ':' 472 | sp_before_constr_colon = ignore # ignore/add/remove/force 473 | 474 | # Add or remove space before case ':'. Default=Remove 475 | sp_before_case_colon = remove # ignore/add/remove/force 476 | 477 | # Add or remove space between 'operator' and operator sign 478 | sp_after_operator = ignore # ignore/add/remove/force 479 | 480 | # Add or remove space between the operator symbol and the open paren, as in 'operator ++(' 481 | sp_after_operator_sym = ignore # ignore/add/remove/force 482 | 483 | # Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a' 484 | sp_after_cast = ignore # ignore/add/remove/force 485 | 486 | # Add or remove spaces inside cast parens 487 | sp_inside_paren_cast = ignore # ignore/add/remove/force 488 | 489 | # Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)' 490 | sp_cpp_cast_paren = ignore # ignore/add/remove/force 491 | 492 | # Add or remove space between 'sizeof' and '(' 493 | sp_sizeof_paren = ignore # ignore/add/remove/force 494 | 495 | # Add or remove space after the tag keyword (Pawn) 496 | sp_after_tag = ignore # ignore/add/remove/force 497 | 498 | # Add or remove space inside enum '{' and '}' 499 | sp_inside_braces_enum = ignore # ignore/add/remove/force 500 | 501 | # Add or remove space inside struct/union '{' and '}' 502 | sp_inside_braces_struct = ignore # ignore/add/remove/force 503 | 504 | # Add or remove space inside '{' and '}' 505 | sp_inside_braces = ignore # ignore/add/remove/force 506 | 507 | # Add or remove space inside '{}' 508 | sp_inside_braces_empty = ignore # ignore/add/remove/force 509 | 510 | # Add or remove space between return type and function name 511 | # A minimum of 1 is forced except for pointer return types. 512 | sp_type_func = ignore # ignore/add/remove/force 513 | 514 | # Add or remove space between function name and '(' on function declaration 515 | sp_func_proto_paren = ignore # ignore/add/remove/force 516 | 517 | # Add or remove space between function name and '(' on function definition 518 | sp_func_def_paren = ignore # ignore/add/remove/force 519 | 520 | # Add or remove space inside empty function '()' 521 | sp_inside_fparens = ignore # ignore/add/remove/force 522 | 523 | # Add or remove space inside function '(' and ')' 524 | sp_inside_fparen = ignore # ignore/add/remove/force 525 | 526 | # Add or remove space inside the first parens in the function type: 'void (*x)(...)' 527 | sp_inside_tparen = ignore # ignore/add/remove/force 528 | 529 | # Add or remove between the parens in the function type: 'void (*x)(...)' 530 | sp_after_tparen_close = ignore # ignore/add/remove/force 531 | 532 | # Add or remove space between ']' and '(' when part of a function call. 533 | sp_square_fparen = ignore # ignore/add/remove/force 534 | 535 | # Add or remove space between ')' and '{' of function 536 | sp_fparen_brace = ignore # ignore/add/remove/force 537 | 538 | # Java: Add or remove space between ')' and '{{' of double brace initializer. 539 | sp_fparen_dbrace = ignore # ignore/add/remove/force 540 | 541 | # Add or remove space between function name and '(' on function calls 542 | sp_func_call_paren = ignore # ignore/add/remove/force 543 | 544 | # Add or remove space between function name and '()' on function calls without parameters. 545 | # If set to 'ignore' (the default), sp_func_call_paren is used. 546 | sp_func_call_paren_empty = ignore # ignore/add/remove/force 547 | 548 | # Add or remove space between the user function name and '(' on function calls 549 | # You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file. 550 | sp_func_call_user_paren = ignore # ignore/add/remove/force 551 | 552 | # Add or remove space between a constructor/destructor and the open paren 553 | sp_func_class_paren = ignore # ignore/add/remove/force 554 | 555 | # Add or remove space between 'return' and '(' 556 | sp_return_paren = ignore # ignore/add/remove/force 557 | 558 | # Add or remove space between '__attribute__' and '(' 559 | sp_attribute_paren = ignore # ignore/add/remove/force 560 | 561 | # Add or remove space between 'defined' and '(' in '#if defined (FOO)' 562 | sp_defined_paren = ignore # ignore/add/remove/force 563 | 564 | # Add or remove space between 'throw' and '(' in 'throw (something)' 565 | sp_throw_paren = ignore # ignore/add/remove/force 566 | 567 | # Add or remove space between 'throw' and anything other than '(' as in '@throw [...];' 568 | sp_after_throw = ignore # ignore/add/remove/force 569 | 570 | # Add or remove space between 'catch' and '(' in 'catch (something) { }' 571 | # If set to ignore, sp_before_sparen is used. 572 | sp_catch_paren = ignore # ignore/add/remove/force 573 | 574 | # Add or remove space between 'version' and '(' in 'version (something) { }' (D language) 575 | # If set to ignore, sp_before_sparen is used. 576 | sp_version_paren = ignore # ignore/add/remove/force 577 | 578 | # Add or remove space between 'scope' and '(' in 'scope (something) { }' (D language) 579 | # If set to ignore, sp_before_sparen is used. 580 | sp_scope_paren = ignore # ignore/add/remove/force 581 | 582 | # Add or remove space between macro and value 583 | sp_macro = ignore # ignore/add/remove/force 584 | 585 | # Add or remove space between macro function ')' and value 586 | sp_macro_func = ignore # ignore/add/remove/force 587 | 588 | # Add or remove space between 'else' and '{' if on the same line 589 | sp_else_brace = ignore # ignore/add/remove/force 590 | 591 | # Add or remove space between '}' and 'else' if on the same line 592 | sp_brace_else = ignore # ignore/add/remove/force 593 | 594 | # Add or remove space between '}' and the name of a typedef on the same line 595 | sp_brace_typedef = ignore # ignore/add/remove/force 596 | 597 | # Add or remove space between 'catch' and '{' if on the same line 598 | sp_catch_brace = ignore # ignore/add/remove/force 599 | 600 | # Add or remove space between '}' and 'catch' if on the same line 601 | sp_brace_catch = ignore # ignore/add/remove/force 602 | 603 | # Add or remove space between 'finally' and '{' if on the same line 604 | sp_finally_brace = ignore # ignore/add/remove/force 605 | 606 | # Add or remove space between '}' and 'finally' if on the same line 607 | sp_brace_finally = ignore # ignore/add/remove/force 608 | 609 | # Add or remove space between 'try' and '{' if on the same line 610 | sp_try_brace = ignore # ignore/add/remove/force 611 | 612 | # Add or remove space between get/set and '{' if on the same line 613 | sp_getset_brace = ignore # ignore/add/remove/force 614 | 615 | # Add or remove space between a variable and '{' for C++ uniform initialization 616 | sp_word_brace = add # ignore/add/remove/force 617 | 618 | # Add or remove space between a variable and '{' for a namespace 619 | sp_word_brace_ns = add # ignore/add/remove/force 620 | 621 | # Add or remove space before the '::' operator 622 | sp_before_dc = ignore # ignore/add/remove/force 623 | 624 | # Add or remove space after the '::' operator 625 | sp_after_dc = ignore # ignore/add/remove/force 626 | 627 | # Add or remove around the D named array initializer ':' operator 628 | sp_d_array_colon = ignore # ignore/add/remove/force 629 | 630 | # Add or remove space after the '!' (not) operator. Default=Remove 631 | sp_not = remove # ignore/add/remove/force 632 | 633 | # Add or remove space after the '~' (invert) operator. Default=Remove 634 | sp_inv = remove # ignore/add/remove/force 635 | 636 | # Add or remove space after the '&' (address-of) operator. Default=Remove 637 | # This does not affect the spacing after a '&' that is part of a type. 638 | sp_addr = remove # ignore/add/remove/force 639 | 640 | # Add or remove space around the '.' or '->' operators. Default=Remove 641 | sp_member = remove # ignore/add/remove/force 642 | 643 | # Add or remove space after the '*' (dereference) operator. Default=Remove 644 | # This does not affect the spacing after a '*' that is part of a type. 645 | sp_deref = remove # ignore/add/remove/force 646 | 647 | # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove 648 | sp_sign = remove # ignore/add/remove/force 649 | 650 | # Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove 651 | sp_incdec = remove # ignore/add/remove/force 652 | 653 | # Add or remove space before a backslash-newline at the end of a line. Default=Add 654 | sp_before_nl_cont = add # ignore/add/remove/force 655 | 656 | # Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' 657 | sp_after_oc_scope = ignore # ignore/add/remove/force 658 | 659 | # Add or remove space after the colon in message specs 660 | # '-(int) f:(int) x;' vs '-(int) f: (int) x;' 661 | sp_after_oc_colon = ignore # ignore/add/remove/force 662 | 663 | # Add or remove space before the colon in message specs 664 | # '-(int) f: (int) x;' vs '-(int) f : (int) x;' 665 | sp_before_oc_colon = ignore # ignore/add/remove/force 666 | 667 | # Add or remove space after the colon in immutable dictionary expression 668 | # 'NSDictionary *test = @{@"foo" :@"bar"};' 669 | sp_after_oc_dict_colon = ignore # ignore/add/remove/force 670 | 671 | # Add or remove space before the colon in immutable dictionary expression 672 | # 'NSDictionary *test = @{@"foo" :@"bar"};' 673 | sp_before_oc_dict_colon = ignore # ignore/add/remove/force 674 | 675 | # Add or remove space after the colon in message specs 676 | # '[object setValue:1];' vs '[object setValue: 1];' 677 | sp_after_send_oc_colon = ignore # ignore/add/remove/force 678 | 679 | # Add or remove space before the colon in message specs 680 | # '[object setValue:1];' vs '[object setValue :1];' 681 | sp_before_send_oc_colon = ignore # ignore/add/remove/force 682 | 683 | # Add or remove space after the (type) in message specs 684 | # '-(int)f: (int) x;' vs '-(int)f: (int)x;' 685 | sp_after_oc_type = ignore # ignore/add/remove/force 686 | 687 | # Add or remove space after the first (type) in message specs 688 | # '-(int) f:(int)x;' vs '-(int)f:(int)x;' 689 | sp_after_oc_return_type = ignore # ignore/add/remove/force 690 | 691 | # Add or remove space between '@selector' and '(' 692 | # '@selector(msgName)' vs '@selector (msgName)' 693 | # Also applies to @protocol() constructs 694 | sp_after_oc_at_sel = ignore # ignore/add/remove/force 695 | 696 | # Add or remove space between '@selector(x)' and the following word 697 | # '@selector(foo) a:' vs '@selector(foo)a:' 698 | sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force 699 | 700 | # Add or remove space inside '@selector' parens 701 | # '@selector(foo)' vs '@selector( foo )' 702 | # Also applies to @protocol() constructs 703 | sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force 704 | 705 | # Add or remove space before a block pointer caret 706 | # '^int (int arg){...}' vs. ' ^int (int arg){...}' 707 | sp_before_oc_block_caret = ignore # ignore/add/remove/force 708 | 709 | # Add or remove space after a block pointer caret 710 | # '^int (int arg){...}' vs. '^ int (int arg){...}' 711 | sp_after_oc_block_caret = ignore # ignore/add/remove/force 712 | 713 | # Add or remove space between the receiver and selector in a message. 714 | # '[receiver selector ...]' 715 | sp_after_oc_msg_receiver = ignore # ignore/add/remove/force 716 | 717 | # Add or remove space after @property. 718 | sp_after_oc_property = ignore # ignore/add/remove/force 719 | 720 | # Add or remove space around the ':' in 'b ? t : f' 721 | sp_cond_colon = ignore # ignore/add/remove/force 722 | 723 | # Add or remove space before the ':' in 'b ? t : f'. Overrides sp_cond_colon. 724 | sp_cond_colon_before = ignore # ignore/add/remove/force 725 | 726 | # Add or remove space after the ':' in 'b ? t : f'. Overrides sp_cond_colon. 727 | sp_cond_colon_after = ignore # ignore/add/remove/force 728 | 729 | # Add or remove space around the '?' in 'b ? t : f' 730 | sp_cond_question = ignore # ignore/add/remove/force 731 | 732 | # Add or remove space before the '?' in 'b ? t : f'. Overrides sp_cond_question. 733 | sp_cond_question_before = ignore # ignore/add/remove/force 734 | 735 | # Add or remove space after the '?' in 'b ? t : f'. Overrides sp_cond_question. 736 | sp_cond_question_after = ignore # ignore/add/remove/force 737 | 738 | # In the abbreviated ternary form (a ?: b), add/remove space between ? and :.'. Overrides all other sp_cond_* options. 739 | sp_cond_ternary_short = ignore # ignore/add/remove/force 740 | 741 | # Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here. 742 | sp_case_label = ignore # ignore/add/remove/force 743 | 744 | # Control the space around the D '..' operator. 745 | sp_range = ignore # ignore/add/remove/force 746 | 747 | # Control the spacing after ':' in 'for (TYPE VAR : EXPR)' (Java) 748 | sp_after_for_colon = ignore # ignore/add/remove/force 749 | 750 | # Control the spacing before ':' in 'for (TYPE VAR : EXPR)' (Java) 751 | sp_before_for_colon = ignore # ignore/add/remove/force 752 | 753 | # Control the spacing in 'extern (C)' (D) 754 | sp_extern_paren = ignore # ignore/add/remove/force 755 | 756 | # Control the space after the opening of a C++ comment '// A' vs '//A' 757 | sp_cmt_cpp_start = ignore # ignore/add/remove/force 758 | 759 | # Controls the spaces between #else or #endif and a trailing comment 760 | sp_endif_cmt = ignore # ignore/add/remove/force 761 | 762 | # Controls the spaces after 'new', 'delete', and 'delete[]' 763 | sp_after_new = ignore # ignore/add/remove/force 764 | 765 | # Controls the spaces before a trailing or embedded comment 766 | sp_before_tr_emb_cmt = ignore # ignore/add/remove/force 767 | 768 | # Number of spaces before a trailing or embedded comment 769 | sp_num_before_tr_emb_cmt = 0 # number 770 | 771 | # Control space between a Java annotation and the open paren. 772 | sp_annotation_paren = ignore # ignore/add/remove/force 773 | 774 | # 775 | # Code alignment (not left column spaces/tabs) 776 | # 777 | 778 | # Whether to keep non-indenting tabs 779 | align_keep_tabs = false # false/true 780 | 781 | # Whether to use tabs for aligning 782 | align_with_tabs = false # false/true 783 | 784 | # Whether to bump out to the next tab when aligning 785 | align_on_tabstop = false # false/true 786 | 787 | # Whether to left-align numbers 788 | align_number_left = false # false/true 789 | 790 | # Whether to keep whitespace not required for alignment. 791 | align_keep_extra_space = false # false/true 792 | 793 | # Align variable definitions in prototypes and functions 794 | align_func_params = false # false/true 795 | 796 | # Align parameters in single-line functions that have the same name. 797 | # The function names must already be aligned with each other. 798 | align_same_func_call_params = false # false/true 799 | 800 | # The span for aligning variable definitions (0=don't align) 801 | align_var_def_span = 0 # number 802 | 803 | # How to align the star in variable definitions. 804 | # 0=Part of the type 'void * foo;' 805 | # 1=Part of the variable 'void *foo;' 806 | # 2=Dangling 'void *foo;' 807 | align_var_def_star_style = 0 # number 808 | 809 | # How to align the '&' in variable definitions. 810 | # 0=Part of the type 811 | # 1=Part of the variable 812 | # 2=Dangling 813 | align_var_def_amp_style = 0 # number 814 | 815 | # The threshold for aligning variable definitions (0=no limit) 816 | align_var_def_thresh = 0 # number 817 | 818 | # The gap for aligning variable definitions 819 | align_var_def_gap = 0 # number 820 | 821 | # Whether to align the colon in struct bit fields 822 | align_var_def_colon = true # false/true 823 | 824 | # Whether to align any attribute after the variable name 825 | align_var_def_attribute = false # false/true 826 | 827 | # Whether to align inline struct/enum/union variable definitions 828 | align_var_def_inline = false # false/true 829 | 830 | # The span for aligning on '=' in assignments (0=don't align) 831 | align_assign_span = 0 # number 832 | 833 | # The threshold for aligning on '=' in assignments (0=no limit) 834 | align_assign_thresh = 0 # number 835 | 836 | # The span for aligning on '=' in enums (0=don't align) 837 | align_enum_equ_span = 0 # number 838 | 839 | # The threshold for aligning on '=' in enums (0=no limit) 840 | align_enum_equ_thresh = 0 # number 841 | 842 | # The span for aligning struct/union (0=don't align) 843 | align_var_struct_span = 0 # number 844 | 845 | # The threshold for aligning struct/union member definitions (0=no limit) 846 | align_var_struct_thresh = 0 # number 847 | 848 | # The gap for aligning struct/union member definitions 849 | align_var_struct_gap = 0 # number 850 | 851 | # The span for aligning struct initializer values (0=don't align) 852 | align_struct_init_span = 0 # number 853 | 854 | # The minimum space between the type and the synonym of a typedef 855 | align_typedef_gap = 0 # number 856 | 857 | # The span for aligning single-line typedefs (0=don't align) 858 | align_typedef_span = 0 # number 859 | 860 | # How to align typedef'd functions with other typedefs 861 | # 0: Don't mix them at all 862 | # 1: align the open paren with the types 863 | # 2: align the function type name with the other type names 864 | align_typedef_func = 0 # number 865 | 866 | # Controls the positioning of the '*' in typedefs. Just try it. 867 | # 0: Align on typedef type, ignore '*' 868 | # 1: The '*' is part of type name: typedef int *pint; 869 | # 2: The '*' is part of the type, but dangling: typedef int *pint; 870 | align_typedef_star_style = 0 # number 871 | 872 | # Controls the positioning of the '&' in typedefs. Just try it. 873 | # 0: Align on typedef type, ignore '&' 874 | # 1: The '&' is part of type name: typedef int &pint; 875 | # 2: The '&' is part of the type, but dangling: typedef int &pint; 876 | align_typedef_amp_style = 0 # number 877 | 878 | # The span for aligning comments that end lines (0=don't align) 879 | align_right_cmt_span = 0 # number 880 | 881 | # If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment 882 | align_right_cmt_mix = false # false/true 883 | 884 | # If a trailing comment is more than this number of columns away from the text it follows, 885 | # it will qualify for being aligned. This has to be > 0 to do anything. 886 | align_right_cmt_gap = 0 # number 887 | 888 | # Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore) 889 | align_right_cmt_at_col = 0 # number 890 | 891 | # The span for aligning function prototypes (0=don't align) 892 | align_func_proto_span = 0 # number 893 | 894 | # Minimum gap between the return type and the function name. 895 | align_func_proto_gap = 0 # number 896 | 897 | # Align function protos on the 'operator' keyword instead of what follows 898 | align_on_operator = false # false/true 899 | 900 | # Whether to mix aligning prototype and variable declarations. 901 | # If true, align_var_def_XXX options are used instead of align_func_proto_XXX options. 902 | align_mix_var_proto = false # false/true 903 | 904 | # Align single-line functions with function prototypes, uses align_func_proto_span 905 | align_single_line_func = false # false/true 906 | 907 | # Aligning the open brace of single-line functions. 908 | # Requires align_single_line_func=true, uses align_func_proto_span 909 | align_single_line_brace = false # false/true 910 | 911 | # Gap for align_single_line_brace. 912 | align_single_line_brace_gap = 0 # number 913 | 914 | # The span for aligning ObjC msg spec (0=don't align) 915 | align_oc_msg_spec_span = 0 # number 916 | 917 | # Whether to align macros wrapped with a backslash and a newline. 918 | # This will not work right if the macro contains a multi-line comment. 919 | align_nl_cont = false # false/true 920 | 921 | # # Align macro functions and variables together 922 | align_pp_define_together = false # false/true 923 | 924 | # The minimum space between label and value of a preprocessor define 925 | align_pp_define_gap = 0 # number 926 | 927 | # The span for aligning on '#define' bodies (0=don't align, other=number of lines including comments between blocks) 928 | align_pp_define_span = 0 # number 929 | 930 | # Align lines that start with '<<' with previous '<<'. Default=true 931 | align_left_shift = true # false/true 932 | 933 | # Span for aligning parameters in an Obj-C message call on the ':' (0=don't align) 934 | align_oc_msg_colon_span = 0 # number 935 | 936 | # If true, always align with the first parameter, even if it is too short. 937 | align_oc_msg_colon_first = false # false/true 938 | 939 | # Aligning parameters in an Obj-C '+' or '-' declaration on the ':' 940 | align_oc_decl_colon = true # false/true 941 | 942 | # 943 | # Newline adding and removing options 944 | # 945 | 946 | # Whether to collapse empty blocks between '{' and '}' 947 | nl_collapse_empty_body = false # false/true 948 | 949 | # Don't split one-line braced assignments - 'foo_t f = { 1, 2 };' 950 | nl_assign_leave_one_liners = false # false/true 951 | 952 | # Don't split one-line braced statements inside a class xx { } body 953 | nl_class_leave_one_liners = false # false/true 954 | 955 | # Don't split one-line enums: 'enum foo { BAR = 15 };' 956 | nl_enum_leave_one_liners = false # false/true 957 | 958 | # Don't split one-line get or set functions 959 | nl_getset_leave_one_liners = false # false/true 960 | 961 | # Don't split one-line function definitions - 'int foo() { return 0; }' 962 | nl_func_leave_one_liners = false # false/true 963 | 964 | # Don't split one-line C++11 lambdas - '[]() { return 0; }' 965 | nl_cpp_lambda_leave_one_liners = false # false/true 966 | 967 | # Don't split one-line if/else statements - 'if(a) b++;' 968 | nl_if_leave_one_liners = false # false/true 969 | 970 | # Don't split one-line OC messages 971 | nl_oc_msg_leave_one_liner = false # false/true 972 | 973 | # Add or remove newlines at the start of the file 974 | nl_start_of_file = ignore # ignore/add/remove/force 975 | 976 | # The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force' 977 | nl_start_of_file_min = 0 # number 978 | 979 | # Add or remove newline at the end of the file 980 | nl_end_of_file = ignore # ignore/add/remove/force 981 | 982 | # The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force') 983 | nl_end_of_file_min = 0 # number 984 | 985 | # Add or remove newline between '=' and '{' 986 | nl_assign_brace = ignore # ignore/add/remove/force 987 | 988 | # Add or remove newline between '=' and '[' (D only) 989 | nl_assign_square = ignore # ignore/add/remove/force 990 | 991 | # Add or remove newline after '= [' (D only). Will also affect the newline before the ']' 992 | nl_after_square_assign = ignore # ignore/add/remove/force 993 | 994 | # The number of blank lines after a block of variable definitions at the top of a function body 995 | # 0 = No change (default) 996 | nl_func_var_def_blk = 0 # number 997 | 998 | # The number of newlines before a block of typedefs 999 | # 0 = No change (default) 1000 | nl_typedef_blk_start = 0 # number 1001 | 1002 | # The number of newlines after a block of typedefs 1003 | # 0 = No change (default) 1004 | nl_typedef_blk_end = 0 # number 1005 | 1006 | # The maximum consecutive newlines within a block of typedefs 1007 | # 0 = No change (default) 1008 | nl_typedef_blk_in = 0 # number 1009 | 1010 | # The number of newlines before a block of variable definitions not at the top of a function body 1011 | # 0 = No change (default) 1012 | nl_var_def_blk_start = 0 # number 1013 | 1014 | # The number of newlines after a block of variable definitions not at the top of a function body 1015 | # 0 = No change (default) 1016 | nl_var_def_blk_end = 0 # number 1017 | 1018 | # The maximum consecutive newlines within a block of variable definitions 1019 | # 0 = No change (default) 1020 | nl_var_def_blk_in = 0 # number 1021 | 1022 | # Add or remove newline between a function call's ')' and '{', as in: 1023 | # list_for_each(item, &list) { } 1024 | nl_fcall_brace = ignore # ignore/add/remove/force 1025 | 1026 | # Add or remove newline between 'enum' and '{' 1027 | nl_enum_brace = ignore # ignore/add/remove/force 1028 | 1029 | # Add or remove newline between 'struct and '{' 1030 | nl_struct_brace = ignore # ignore/add/remove/force 1031 | 1032 | # Add or remove newline between 'union' and '{' 1033 | nl_union_brace = ignore # ignore/add/remove/force 1034 | 1035 | # Add or remove newline between 'if' and '{' 1036 | nl_if_brace = ignore # ignore/add/remove/force 1037 | 1038 | # Add or remove newline between '}' and 'else' 1039 | nl_brace_else = ignore # ignore/add/remove/force 1040 | 1041 | # Add or remove newline between 'else if' and '{' 1042 | # If set to ignore, nl_if_brace is used instead 1043 | nl_elseif_brace = ignore # ignore/add/remove/force 1044 | 1045 | # Add or remove newline between 'else' and '{' 1046 | nl_else_brace = ignore # ignore/add/remove/force 1047 | 1048 | # Add or remove newline between 'else' and 'if' 1049 | nl_else_if = ignore # ignore/add/remove/force 1050 | 1051 | # Add or remove newline between '}' and 'finally' 1052 | nl_brace_finally = ignore # ignore/add/remove/force 1053 | 1054 | # Add or remove newline between 'finally' and '{' 1055 | nl_finally_brace = ignore # ignore/add/remove/force 1056 | 1057 | # Add or remove newline between 'try' and '{' 1058 | nl_try_brace = ignore # ignore/add/remove/force 1059 | 1060 | # Add or remove newline between get/set and '{' 1061 | nl_getset_brace = ignore # ignore/add/remove/force 1062 | 1063 | # Add or remove newline between 'for' and '{' 1064 | nl_for_brace = ignore # ignore/add/remove/force 1065 | 1066 | # Add or remove newline between 'catch' and '{' 1067 | nl_catch_brace = ignore # ignore/add/remove/force 1068 | 1069 | # Add or remove newline between '}' and 'catch' 1070 | nl_brace_catch = ignore # ignore/add/remove/force 1071 | 1072 | # Add or remove newline between '}' and ']' 1073 | nl_brace_square = ignore # ignore/add/remove/force 1074 | 1075 | # Add or remove newline between '}' and ')' in a function invocation 1076 | nl_brace_fparen = ignore # ignore/add/remove/force 1077 | 1078 | # Add or remove newline between 'while' and '{' 1079 | nl_while_brace = ignore # ignore/add/remove/force 1080 | 1081 | # Add or remove newline between 'scope (x)' and '{' (D) 1082 | nl_scope_brace = ignore # ignore/add/remove/force 1083 | 1084 | # Add or remove newline between 'unittest' and '{' (D) 1085 | nl_unittest_brace = ignore # ignore/add/remove/force 1086 | 1087 | # Add or remove newline between 'version (x)' and '{' (D) 1088 | nl_version_brace = ignore # ignore/add/remove/force 1089 | 1090 | # Add or remove newline between 'using' and '{' 1091 | nl_using_brace = ignore # ignore/add/remove/force 1092 | 1093 | # Add or remove newline between two open or close braces. 1094 | # Due to general newline/brace handling, REMOVE may not work. 1095 | nl_brace_brace = ignore # ignore/add/remove/force 1096 | 1097 | # Add or remove newline between 'do' and '{' 1098 | nl_do_brace = ignore # ignore/add/remove/force 1099 | 1100 | # Add or remove newline between '}' and 'while' of 'do' statement 1101 | nl_brace_while = ignore # ignore/add/remove/force 1102 | 1103 | # Add or remove newline between 'switch' and '{' 1104 | nl_switch_brace = ignore # ignore/add/remove/force 1105 | 1106 | # Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc. 1107 | # Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace. 1108 | nl_multi_line_cond = false # false/true 1109 | 1110 | # Force a newline in a define after the macro name for multi-line defines. 1111 | nl_multi_line_define = false # false/true 1112 | 1113 | # Whether to put a newline before 'case' statement 1114 | nl_before_case = false # false/true 1115 | 1116 | # Add or remove newline between ')' and 'throw' 1117 | nl_before_throw = ignore # ignore/add/remove/force 1118 | 1119 | # Whether to put a newline after 'case' statement 1120 | nl_after_case = false # false/true 1121 | 1122 | # Add or remove a newline between a case ':' and '{'. Overrides nl_after_case. 1123 | nl_case_colon_brace = ignore # ignore/add/remove/force 1124 | 1125 | # Newline between namespace and { 1126 | nl_namespace_brace = ignore # ignore/add/remove/force 1127 | 1128 | # Add or remove newline between 'template<>' and whatever follows. 1129 | nl_template_class = ignore # ignore/add/remove/force 1130 | 1131 | # Add or remove newline between 'class' and '{' 1132 | nl_class_brace = ignore # ignore/add/remove/force 1133 | 1134 | # Add or remove newline after each ',' in the class base list 1135 | nl_class_init_args = ignore # ignore/add/remove/force 1136 | 1137 | # Add or remove newline after each ',' in the constructor member initialization 1138 | nl_constr_init_args = ignore # ignore/add/remove/force 1139 | 1140 | # Add or remove newline between return type and function name in a function definition 1141 | nl_func_type_name = ignore # ignore/add/remove/force 1142 | 1143 | # Add or remove newline between return type and function name inside a class {} 1144 | # Uses nl_func_type_name or nl_func_proto_type_name if set to ignore. 1145 | nl_func_type_name_class = ignore # ignore/add/remove/force 1146 | 1147 | # Add or remove newline between function scope and name in a definition 1148 | # Controls the newline after '::' in 'void A::f() { }' 1149 | nl_func_scope_name = ignore # ignore/add/remove/force 1150 | 1151 | # Add or remove newline between return type and function name in a prototype 1152 | nl_func_proto_type_name = ignore # ignore/add/remove/force 1153 | 1154 | # Add or remove newline between a function name and the opening '(' 1155 | nl_func_paren = ignore # ignore/add/remove/force 1156 | 1157 | # Add or remove newline between a function name and the opening '(' in the definition 1158 | nl_func_def_paren = ignore # ignore/add/remove/force 1159 | 1160 | # Add or remove newline after '(' in a function declaration 1161 | nl_func_decl_start = ignore # ignore/add/remove/force 1162 | 1163 | # Add or remove newline after '(' in a function definition 1164 | nl_func_def_start = ignore # ignore/add/remove/force 1165 | 1166 | # Overrides nl_func_decl_start when there is only one parameter. 1167 | nl_func_decl_start_single = ignore # ignore/add/remove/force 1168 | 1169 | # Overrides nl_func_def_start when there is only one parameter. 1170 | nl_func_def_start_single = ignore # ignore/add/remove/force 1171 | 1172 | # Add or remove newline after each ',' in a function declaration 1173 | nl_func_decl_args = ignore # ignore/add/remove/force 1174 | 1175 | # Add or remove newline after each ',' in a function definition 1176 | nl_func_def_args = ignore # ignore/add/remove/force 1177 | 1178 | # Add or remove newline before the ')' in a function declaration 1179 | nl_func_decl_end = ignore # ignore/add/remove/force 1180 | 1181 | # Add or remove newline before the ')' in a function definition 1182 | nl_func_def_end = ignore # ignore/add/remove/force 1183 | 1184 | # Overrides nl_func_decl_end when there is only one parameter. 1185 | nl_func_decl_end_single = ignore # ignore/add/remove/force 1186 | 1187 | # Overrides nl_func_def_end when there is only one parameter. 1188 | nl_func_def_end_single = ignore # ignore/add/remove/force 1189 | 1190 | # Add or remove newline between '()' in a function declaration. 1191 | nl_func_decl_empty = ignore # ignore/add/remove/force 1192 | 1193 | # Add or remove newline between '()' in a function definition. 1194 | nl_func_def_empty = ignore # ignore/add/remove/force 1195 | 1196 | # Whether to put each OC message parameter on a separate line 1197 | # See nl_oc_msg_leave_one_liner 1198 | nl_oc_msg_args = false # false/true 1199 | 1200 | # Add or remove newline between function signature and '{' 1201 | nl_fdef_brace = ignore # ignore/add/remove/force 1202 | 1203 | # Add or remove newline between C++11 lambda signature and '{' 1204 | nl_cpp_ldef_brace = ignore # ignore/add/remove/force 1205 | 1206 | # Add or remove a newline between the return keyword and return expression. 1207 | nl_return_expr = ignore # ignore/add/remove/force 1208 | 1209 | # Whether to put a newline after semicolons, except in 'for' statements 1210 | nl_after_semicolon = false # false/true 1211 | 1212 | # Java: Control the newline between the ')' and '{{' of the double brace initializer. 1213 | nl_paren_dbrace_open = ignore # ignore/add/remove/force 1214 | 1215 | # Whether to put a newline after brace open. 1216 | # This also adds a newline before the matching brace close. 1217 | nl_after_brace_open = false # false/true 1218 | 1219 | # If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is 1220 | # placed between the open brace and a trailing single-line comment. 1221 | nl_after_brace_open_cmt = false # false/true 1222 | 1223 | # Whether to put a newline after a virtual brace open with a non-empty body. 1224 | # These occur in un-braced if/while/do/for statement bodies. 1225 | nl_after_vbrace_open = false # false/true 1226 | 1227 | # Whether to put a newline after a virtual brace open with an empty body. 1228 | # These occur in un-braced if/while/do/for statement bodies. 1229 | nl_after_vbrace_open_empty = false # false/true 1230 | 1231 | # Whether to put a newline after a brace close. 1232 | # Does not apply if followed by a necessary ';'. 1233 | nl_after_brace_close = false # false/true 1234 | 1235 | # Whether to put a newline after a virtual brace close. 1236 | # Would add a newline before return in: 'if (foo) a++; return;' 1237 | nl_after_vbrace_close = false # false/true 1238 | 1239 | # Control the newline between the close brace and 'b' in: 'struct { int a; } b;' 1240 | # Affects enums, unions, and structures. If set to ignore, uses nl_after_brace_close 1241 | nl_brace_struct_var = ignore # ignore/add/remove/force 1242 | 1243 | # Whether to alter newlines in '#define' macros 1244 | nl_define_macro = false # false/true 1245 | 1246 | # Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' 1247 | nl_squeeze_ifdef = false # false/true 1248 | 1249 | # Add or remove blank line before 'if' 1250 | nl_before_if = ignore # ignore/add/remove/force 1251 | 1252 | # Add or remove blank line after 'if' statement 1253 | nl_after_if = ignore # ignore/add/remove/force 1254 | 1255 | # Add or remove blank line before 'for' 1256 | nl_before_for = ignore # ignore/add/remove/force 1257 | 1258 | # Add or remove blank line after 'for' statement 1259 | nl_after_for = ignore # ignore/add/remove/force 1260 | 1261 | # Add or remove blank line before 'while' 1262 | nl_before_while = ignore # ignore/add/remove/force 1263 | 1264 | # Add or remove blank line after 'while' statement 1265 | nl_after_while = ignore # ignore/add/remove/force 1266 | 1267 | # Add or remove blank line before 'switch' 1268 | nl_before_switch = ignore # ignore/add/remove/force 1269 | 1270 | # Add or remove blank line after 'switch' statement 1271 | nl_after_switch = ignore # ignore/add/remove/force 1272 | 1273 | # Add or remove blank line before 'do' 1274 | nl_before_do = ignore # ignore/add/remove/force 1275 | 1276 | # Add or remove blank line after 'do/while' statement 1277 | nl_after_do = ignore # ignore/add/remove/force 1278 | 1279 | # Whether to double-space commented-entries in struct/enum 1280 | nl_ds_struct_enum_cmt = false # false/true 1281 | 1282 | # Whether to double-space before the close brace of a struct/union/enum 1283 | # (lower priority than 'eat_blanks_before_close_brace') 1284 | nl_ds_struct_enum_close_brace = false # false/true 1285 | 1286 | # Add or remove a newline around a class colon. 1287 | # Related to pos_class_colon, nl_class_init_args, and pos_class_comma. 1288 | nl_class_colon = ignore # ignore/add/remove/force 1289 | 1290 | # Add or remove a newline around a class constructor colon. 1291 | # Related to pos_constr_colon, nl_constr_init_args, and pos_constr_comma. 1292 | nl_constr_colon = ignore # ignore/add/remove/force 1293 | 1294 | # Change simple unbraced if statements into a one-liner 1295 | # 'if(b)\n i++;' => 'if(b) i++;' 1296 | nl_create_if_one_liner = false # false/true 1297 | 1298 | # Change simple unbraced for statements into a one-liner 1299 | # 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);' 1300 | nl_create_for_one_liner = false # false/true 1301 | 1302 | # Change simple unbraced while statements into a one-liner 1303 | # 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);' 1304 | nl_create_while_one_liner = false # false/true 1305 | 1306 | # 1307 | # Positioning options 1308 | # 1309 | 1310 | # The position of arithmetic operators in wrapped expressions 1311 | pos_arith = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1312 | 1313 | # The position of assignment in wrapped expressions. 1314 | # Do not affect '=' followed by '{' 1315 | pos_assign = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1316 | 1317 | # The position of boolean operators in wrapped expressions 1318 | pos_bool = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1319 | 1320 | # The position of comparison operators in wrapped expressions 1321 | pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1322 | 1323 | # The position of conditional (b ? t : f) operators in wrapped expressions 1324 | pos_conditional = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1325 | 1326 | # The position of the comma in wrapped expressions 1327 | pos_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1328 | 1329 | # The position of the comma in the class base list 1330 | pos_class_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1331 | 1332 | # The position of the comma in the constructor initialization list 1333 | pos_constr_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1334 | 1335 | # The position of colons between class and base class list 1336 | pos_class_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1337 | 1338 | # The position of colons between constructor and member initialization 1339 | pos_constr_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1340 | 1341 | # 1342 | # Line Splitting options 1343 | # 1344 | 1345 | # Try to limit code width to N number of columns 1346 | code_width = 0 # number 1347 | 1348 | # Whether to fully split long 'for' statements at semi-colons 1349 | ls_for_split_full = false # false/true 1350 | 1351 | # Whether to fully split long function protos/calls at commas 1352 | ls_func_split_full = false # false/true 1353 | 1354 | # Whether to split lines as close to code_width as possible and ignore some groupings 1355 | ls_code_width = false # false/true 1356 | 1357 | # 1358 | # Blank line options 1359 | # 1360 | 1361 | # The maximum consecutive newlines 1362 | nl_max = 0 # number 1363 | 1364 | # The number of newlines after a function prototype, if followed by another function prototype 1365 | nl_after_func_proto = 0 # number 1366 | 1367 | # The number of newlines after a function prototype, if not followed by another function prototype 1368 | nl_after_func_proto_group = 0 # number 1369 | 1370 | # The number of newlines after '}' of a multi-line function body 1371 | nl_after_func_body = 0 # number 1372 | 1373 | # The number of newlines after '}' of a multi-line function body in a class declaration 1374 | nl_after_func_body_class = 0 # number 1375 | 1376 | # The number of newlines after '}' of a single line function body 1377 | nl_after_func_body_one_liner = 0 # number 1378 | 1379 | # The minimum number of newlines before a multi-line comment. 1380 | # Doesn't apply if after a brace open or another multi-line comment. 1381 | nl_before_block_comment = 0 # number 1382 | 1383 | # The minimum number of newlines before a single-line C comment. 1384 | # Doesn't apply if after a brace open or other single-line C comments. 1385 | nl_before_c_comment = 0 # number 1386 | 1387 | # The minimum number of newlines before a CPP comment. 1388 | # Doesn't apply if after a brace open or other CPP comments. 1389 | nl_before_cpp_comment = 0 # number 1390 | 1391 | # Whether to force a newline after a multi-line comment. 1392 | nl_after_multiline_comment = false # false/true 1393 | 1394 | # The number of newlines after '}' or ';' of a struct/enum/union definition 1395 | nl_after_struct = 0 # number 1396 | 1397 | # The number of newlines after '}' or ';' of a class definition 1398 | nl_after_class = 0 # number 1399 | 1400 | # The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. 1401 | # Will not change the newline count if after a brace open. 1402 | # 0 = No change. 1403 | nl_before_access_spec = 0 # number 1404 | 1405 | # The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. 1406 | # 0 = No change. 1407 | nl_after_access_spec = 0 # number 1408 | 1409 | # The number of newlines between a function def and the function comment. 1410 | # 0 = No change. 1411 | nl_comment_func_def = 0 # number 1412 | 1413 | # The number of newlines after a try-catch-finally block that isn't followed by a brace close. 1414 | # 0 = No change. 1415 | nl_after_try_catch_finally = 0 # number 1416 | 1417 | # The number of newlines before and after a property, indexer or event decl. 1418 | # 0 = No change. 1419 | nl_around_cs_property = 0 # number 1420 | 1421 | # The number of newlines between the get/set/add/remove handlers in C#. 1422 | # 0 = No change. 1423 | nl_between_get_set = 0 # number 1424 | 1425 | # Add or remove newline between C# property and the '{' 1426 | nl_property_brace = ignore # ignore/add/remove/force 1427 | 1428 | # Whether to remove blank lines after '{' 1429 | eat_blanks_after_open_brace = false # false/true 1430 | 1431 | # Whether to remove blank lines before '}' 1432 | eat_blanks_before_close_brace = false # false/true 1433 | 1434 | # How aggressively to remove extra newlines not in preproc. 1435 | # 0: No change 1436 | # 1: Remove most newlines not handled by other config 1437 | # 2: Remove all newlines and reformat completely by config 1438 | nl_remove_extra_newlines = 0 # number 1439 | 1440 | # Whether to put a blank line before 'return' statements, unless after an open brace. 1441 | nl_before_return = false # false/true 1442 | 1443 | # Whether to put a blank line after 'return' statements, unless followed by a close brace. 1444 | nl_after_return = false # false/true 1445 | 1446 | # Whether to put a newline after a Java annotation statement. 1447 | # Only affects annotations that are after a newline. 1448 | nl_after_annotation = ignore # ignore/add/remove/force 1449 | 1450 | # Controls the newline between two annotations. 1451 | nl_between_annotation = ignore # ignore/add/remove/force 1452 | 1453 | # 1454 | # Code modifying options (non-whitespace) 1455 | # 1456 | 1457 | # Add or remove braces on single-line 'do' statement 1458 | mod_full_brace_do = ignore # ignore/add/remove/force 1459 | 1460 | # Add or remove braces on single-line 'for' statement 1461 | mod_full_brace_for = ignore # ignore/add/remove/force 1462 | 1463 | # Add or remove braces on single-line function definitions. (Pawn) 1464 | mod_full_brace_function = ignore # ignore/add/remove/force 1465 | 1466 | # Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. 1467 | mod_full_brace_if = ignore # ignore/add/remove/force 1468 | 1469 | # Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if. 1470 | # If any must be braced, they are all braced. If all can be unbraced, then the braces are removed. 1471 | mod_full_brace_if_chain = false # false/true 1472 | 1473 | # Don't remove braces around statements that span N newlines 1474 | mod_full_brace_nl = 0 # number 1475 | 1476 | # Add or remove braces on single-line 'while' statement 1477 | mod_full_brace_while = ignore # ignore/add/remove/force 1478 | 1479 | # Add or remove braces on single-line 'using ()' statement 1480 | mod_full_brace_using = ignore # ignore/add/remove/force 1481 | 1482 | # Add or remove unnecessary paren on 'return' statement 1483 | mod_paren_on_return = ignore # ignore/add/remove/force 1484 | 1485 | # Whether to change optional semicolons to real semicolons 1486 | mod_pawn_semicolon = false # false/true 1487 | 1488 | # Add parens on 'while' and 'if' statement around bools 1489 | mod_full_paren_if_bool = false # false/true 1490 | 1491 | # Whether to remove superfluous semicolons 1492 | mod_remove_extra_semicolon = false # false/true 1493 | 1494 | # If a function body exceeds the specified number of newlines and doesn't have a comment after 1495 | # the close brace, a comment will be added. 1496 | mod_add_long_function_closebrace_comment = 0 # number 1497 | 1498 | # If a namespace body exceeds the specified number of newlines and doesn't have a comment after 1499 | # the close brace, a comment will be added. 1500 | mod_add_long_namespace_closebrace_comment = 0 # number 1501 | 1502 | # If a switch body exceeds the specified number of newlines and doesn't have a comment after 1503 | # the close brace, a comment will be added. 1504 | mod_add_long_switch_closebrace_comment = 0 # number 1505 | 1506 | # If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after 1507 | # the #endif, a comment will be added. 1508 | mod_add_long_ifdef_endif_comment = 0 # number 1509 | 1510 | # If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after 1511 | # the #else, a comment will be added. 1512 | mod_add_long_ifdef_else_comment = 0 # number 1513 | 1514 | # If TRUE, will sort consecutive single-line 'import' statements [Java, D] 1515 | mod_sort_import = false # false/true 1516 | 1517 | # If TRUE, will sort consecutive single-line 'using' statements [C#] 1518 | mod_sort_using = false # false/true 1519 | 1520 | # If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C] 1521 | # This is generally a bad idea, as it may break your code. 1522 | mod_sort_include = false # false/true 1523 | 1524 | # If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. 1525 | mod_move_case_break = false # false/true 1526 | 1527 | # Will add or remove the braces around a fully braced case statement. 1528 | # Will only remove the braces if there are no variable declarations in the block. 1529 | mod_case_brace = ignore # ignore/add/remove/force 1530 | 1531 | # If TRUE, it will remove a void 'return;' that appears as the last statement in a function. 1532 | mod_remove_empty_return = false # false/true 1533 | 1534 | # 1535 | # Comment modifications 1536 | # 1537 | 1538 | # Try to wrap comments at cmt_width columns 1539 | cmt_width = 0 # number 1540 | 1541 | # Set the comment reflow mode (default: 0) 1542 | # 0: no reflowing (apart from the line wrapping due to cmt_width) 1543 | # 1: no touching at all 1544 | # 2: full reflow 1545 | cmt_reflow_mode = 0 # number 1546 | 1547 | # Whether to convert all tabs to spaces in comments. Default is to leave tabs inside comments alone, unless used for indenting. 1548 | cmt_convert_tab_to_spaces = false # false/true 1549 | 1550 | # If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars. 1551 | # Default is true. 1552 | cmt_indent_multi = true # false/true 1553 | 1554 | # Whether to group c-comments that look like they are in a block 1555 | cmt_c_group = false # false/true 1556 | 1557 | # Whether to put an empty '/*' on the first line of the combined c-comment 1558 | cmt_c_nl_start = false # false/true 1559 | 1560 | # Whether to put a newline before the closing '*/' of the combined c-comment 1561 | cmt_c_nl_end = false # false/true 1562 | 1563 | # Whether to group cpp-comments that look like they are in a block 1564 | cmt_cpp_group = false # false/true 1565 | 1566 | # Whether to put an empty '/*' on the first line of the combined cpp-comment 1567 | cmt_cpp_nl_start = false # false/true 1568 | 1569 | # Whether to put a newline before the closing '*/' of the combined cpp-comment 1570 | cmt_cpp_nl_end = false # false/true 1571 | 1572 | # Whether to change cpp-comments into c-comments 1573 | cmt_cpp_to_c = false # false/true 1574 | 1575 | # Whether to put a star on subsequent comment lines 1576 | cmt_star_cont = false # false/true 1577 | 1578 | # The number of spaces to insert at the start of subsequent comment lines 1579 | cmt_sp_before_star_cont = 0 # number 1580 | 1581 | # The number of spaces to insert after the star on subsequent comment lines 1582 | cmt_sp_after_star_cont = 0 # number 1583 | 1584 | # For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of 1585 | # the comment are the same length. Default=True 1586 | cmt_multi_check_last = true # false/true 1587 | 1588 | # The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment. 1589 | # Will substitute $(filename) with the current file's name. 1590 | cmt_insert_file_header = "" # string 1591 | 1592 | # The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment. 1593 | # Will substitute $(filename) with the current file's name. 1594 | cmt_insert_file_footer = "" # string 1595 | 1596 | # The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment. 1597 | # Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff. 1598 | # Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... } 1599 | cmt_insert_func_header = "" # string 1600 | 1601 | # The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment. 1602 | # Will substitute $(class) with the class name. 1603 | cmt_insert_class_header = "" # string 1604 | 1605 | # The filename that contains text to insert before a Obj-C message specification if the method isn't preceded with a C/C++ comment. 1606 | # Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff. 1607 | cmt_insert_oc_msg_header = "" # string 1608 | 1609 | # If a preprocessor is encountered when stepping backwards from a function name, then 1610 | # this option decides whether the comment should be inserted. 1611 | # Affects cmt_insert_oc_msg_header, cmt_insert_func_header and cmt_insert_class_header. 1612 | cmt_insert_before_preproc = false # false/true 1613 | 1614 | # 1615 | # Preprocessor options 1616 | # 1617 | 1618 | # Control indent of preprocessors inside #if blocks at brace level 0 (file-level) 1619 | pp_indent = ignore # ignore/add/remove/force 1620 | 1621 | # Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false) 1622 | pp_indent_at_level = false # false/true 1623 | 1624 | # Specifies the number of columns to indent preprocessors per level at brace level 0 (file-level). 1625 | # If pp_indent_at_level=false, specifies the number of columns to indent preprocessors per level at brace level > 0 (function-level). 1626 | # Default=1. 1627 | pp_indent_count = 1 # number 1628 | 1629 | # Add or remove space after # based on pp_level of #if blocks 1630 | pp_space = ignore # ignore/add/remove/force 1631 | 1632 | # Sets the number of spaces added with pp_space 1633 | pp_space_count = 0 # number 1634 | 1635 | # The indent for #region and #endregion in C# and '#pragma region' in C/C++ 1636 | pp_indent_region = 0 # number 1637 | 1638 | # Whether to indent the code between #region and #endregion 1639 | pp_region_indent_code = false # false/true 1640 | 1641 | # If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level. 1642 | # 0: indent preprocessors using output_tab_size. 1643 | # >0: column at which all preprocessors will be indented. 1644 | pp_indent_if = 0 # number 1645 | 1646 | # Control whether to indent the code between #if, #else and #endif. 1647 | pp_if_indent_code = false # false/true 1648 | 1649 | # Whether to indent '#define' at the brace level (true) or from column 1 (false) 1650 | pp_define_at_level = false # false/true 1651 | 1652 | # You can force a token to be a type with the 'type' option. 1653 | # Example: 1654 | # type myfoo1 myfoo2 1655 | # 1656 | # You can create custom macro-based indentation using macro-open, 1657 | # macro-else and macro-close. 1658 | # Example: 1659 | # macro-open BEGIN_TEMPLATE_MESSAGE_MAP 1660 | # macro-open BEGIN_MESSAGE_MAP 1661 | # macro-close END_MESSAGE_MAP 1662 | # 1663 | # You can assign any keyword to any type with the set option. 1664 | # set func_call_user _ N_ 1665 | # 1666 | # The full syntax description of all custom definition config entries 1667 | # is shown below: 1668 | # 1669 | # define custom tokens as: 1670 | # - embed whitespace in token using '' escape character, or 1671 | # put token in quotes 1672 | # - these: ' " and ` are recognized as quote delimiters 1673 | # 1674 | # type token1 token2 token3 ... 1675 | # ^ optionally specify multiple tokens on a single line 1676 | # define def_token output_token 1677 | # ^ output_token is optional, then NULL is assumed 1678 | # macro-open token 1679 | # macro-close token 1680 | # macro-else token 1681 | # set id token1 token2 ... 1682 | # ^ optionally specify multiple tokens on a single line 1683 | # ^ id is one of the names in token_enum.h sans the CT_ prefix, 1684 | # e.g. PP_PRAGMA 1685 | # 1686 | # all tokens are separated by any mix of ',' commas, '=' equal signs 1687 | # and whitespace (space, tab) 1688 | # 1689 | # You can add support for other file extensions using the 'file_ext' command. 1690 | # The first arg is the language name used with the '-l' option. 1691 | # The remaining args are file extensions, matched with 'endswith'. 1692 | # file_ext CPP .ch .cxx .cpp.in 1693 | # 1694 | --------------------------------------------------------------------------------