diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 5be256af..bd4d79bc 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -7,6 +7,14 @@ objects = { /* Begin PBXBuildFile section */ + 186A52E026FC559200D67B2C /* SecurityGuardSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 186A52DA26FC559200D67B2C /* SecurityGuardSDK.framework */; }; + 186A52E126FC559200D67B2C /* SGSecurityBody.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 186A52DB26FC559200D67B2C /* SGSecurityBody.framework */; }; + 186A52E226FC559200D67B2C /* RPSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 186A52DC26FC559200D67B2C /* RPSDK.framework */; }; + 186A52E326FC559200D67B2C /* RPSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 186A52DD26FC559200D67B2C /* RPSDK.bundle */; }; + 186A52E426FC559200D67B2C /* SGMain.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 186A52DE26FC559200D67B2C /* SGMain.framework */; }; + 186A52E526FC559200D67B2C /* AliyunOSSiOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 186A52DF26FC559200D67B2C /* AliyunOSSiOS.framework */; }; + 186A52E726FC559700D67B2C /* yw_1222_0769.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 186A52E626FC559700D67B2C /* yw_1222_0769.jpg */; }; + 186A531926FC592100D67B2C /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 186A531826FC591100D67B2C /* libresolv.tbd */; }; 187EEEDC26E89B32002833B2 /* BaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 187EEEDB26E89B32002833B2 /* BaseModel.m */; }; 187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 187EEEE026E89BFB002833B2 /* AccountModel.m */; }; 187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 187EEEEE26E89FE8002833B2 /* AccountInfoStorage.m */; }; @@ -172,6 +180,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 186A52DA26FC559200D67B2C /* SecurityGuardSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SecurityGuardSDK.framework; sourceTree = ""; }; + 186A52DB26FC559200D67B2C /* SGSecurityBody.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SGSecurityBody.framework; sourceTree = ""; }; + 186A52DC26FC559200D67B2C /* RPSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RPSDK.framework; sourceTree = ""; }; + 186A52DD26FC559200D67B2C /* RPSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = RPSDK.bundle; sourceTree = ""; }; + 186A52DE26FC559200D67B2C /* SGMain.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SGMain.framework; sourceTree = ""; }; + 186A52DF26FC559200D67B2C /* AliyunOSSiOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AliyunOSSiOS.framework; sourceTree = ""; }; + 186A52E626FC559700D67B2C /* yw_1222_0769.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = yw_1222_0769.jpg; sourceTree = ""; }; + 186A531826FC591100D67B2C /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; 187EEEDA26E89B32002833B2 /* BaseModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseModel.h; sourceTree = ""; }; 187EEEDB26E89B32002833B2 /* BaseModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseModel.m; sourceTree = ""; }; 187EEEDF26E89BFB002833B2 /* AccountModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccountModel.h; sourceTree = ""; }; @@ -430,12 +446,18 @@ buildActionMask = 2147483647; files = ( 18E7B25B26E8D4460064BC9B /* Flutter.xcframework in Frameworks */, + 186A52E526FC559200D67B2C /* AliyunOSSiOS.framework in Frameworks */, 73FFADDC93E195344047A2EC /* Pods_xplan_ios.framework in Frameworks */, 18E7B25F26E8D44B0064BC9B /* FMDB.xcframework in Frameworks */, + 186A52E426FC559200D67B2C /* SGMain.framework in Frameworks */, 18E7B26126E8D44D0064BC9B /* path_provider.xcframework in Frameworks */, 18E7B26326E8D4500064BC9B /* sqflite.xcframework in Frameworks */, + 186A531926FC592100D67B2C /* libresolv.tbd in Frameworks */, 18E7B26526E8D4510064BC9B /* Toast.xcframework in Frameworks */, + 186A52E026FC559200D67B2C /* SecurityGuardSDK.framework in Frameworks */, 18E7B25D26E8D4490064BC9B /* fluttertoast.xcframework in Frameworks */, + 186A52E226FC559200D67B2C /* RPSDK.framework in Frameworks */, + 186A52E126FC559200D67B2C /* SGSecurityBody.framework in Frameworks */, 18E7B25926E8D4440064BC9B /* flutter_boost.xcframework in Frameworks */, 18E7B25726E8D4430064BC9B /* App.xcframework in Frameworks */, 18E7B25326E8D43D0064BC9B /* FlutterPluginRegistrant.xcframework in Frameworks */, @@ -445,6 +467,28 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 186A52D826FC551700D67B2C /* Library */ = { + isa = PBXGroup; + children = ( + 186A52D926FC558500D67B2C /* RPSDK */, + ); + path = Library; + sourceTree = ""; + }; + 186A52D926FC558500D67B2C /* RPSDK */ = { + isa = PBXGroup; + children = ( + 186A52DF26FC559200D67B2C /* AliyunOSSiOS.framework */, + 186A52DC26FC559200D67B2C /* RPSDK.framework */, + 186A52DA26FC559200D67B2C /* SecurityGuardSDK.framework */, + 186A52DE26FC559200D67B2C /* SGMain.framework */, + 186A52DB26FC559200D67B2C /* SGSecurityBody.framework */, + 186A52DD26FC559200D67B2C /* RPSDK.bundle */, + 186A52E626FC559700D67B2C /* yw_1222_0769.jpg */, + ); + path = RPSDK; + sourceTree = ""; + }; 187EEEA926E62679002833B2 /* Api */ = { isa = PBXGroup; children = ( @@ -475,6 +519,7 @@ 189DD52B26DE255300AB55B1 /* xplan-ios */ = { isa = PBXGroup; children = ( + 186A52D826FC551700D67B2C /* Library */, E81C279926EB64BA0031E639 /* Global */, 189DD56B26DF5B0900AB55B1 /* Base */, 189DD56126DE45F800AB55B1 /* Main */, @@ -790,6 +835,7 @@ BFB922F5D81845AC32D1E1ED /* Frameworks */ = { isa = PBXGroup; children = ( + 186A531826FC591100D67B2C /* libresolv.tbd */, CACF623970097D653132D69A /* Pods_xplan_ios.framework */, ); name = Frameworks; @@ -1139,6 +1185,8 @@ files = ( 189DD53C26DE255600AB55B1 /* LaunchScreen.storyboard in Resources */, 189DD53926DE255600AB55B1 /* Assets.xcassets in Resources */, + 186A52E726FC559700D67B2C /* yw_1222_0769.jpg in Resources */, + 186A52E326FC559200D67B2C /* RPSDK.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1466,6 +1514,10 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 48UCG35Q9W; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/xplan-ios/Library/RPSDK", + ); GCC_PREFIX_HEADER = "xplan-ios/Base/Base.pch"; INFOPLIST_FILE = "xplan-ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1488,6 +1540,10 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 48UCG35Q9W; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/xplan-ios/Library/RPSDK", + ); GCC_PREFIX_HEADER = "xplan-ios/Base/Base.pch"; INFOPLIST_FILE = "xplan-ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/AliyunOSSiOS b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/AliyunOSSiOS new file mode 100644 index 00000000..21ff07b9 Binary files /dev/null and b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/AliyunOSSiOS differ diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/AliyunOSSiOS.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/AliyunOSSiOS.h new file mode 100644 index 00000000..e638560b --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/AliyunOSSiOS.h @@ -0,0 +1,22 @@ +// +// AliyunOSSiOS.h +// AliyunOSSiOS +// +// Created by xuyecan on 28/11/2016. +// Copyright © 2016 xuyecan. All rights reserved. +// + +#import + +//! Project version number for AliyunOSSiOS. +FOUNDATION_EXPORT double AliyunOSSiOSVersionNumber; + +//! Project version string for AliyunOSSiOS. +FOUNDATION_EXPORT const unsigned char AliyunOSSiOSVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import "OSSService.h" +#import "OSSCompat.h" +#import "OSSXMLDictionary.h" +#import "OSSIPv6Adapter.h" diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSDate+OSS.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSDate+OSS.h new file mode 100644 index 00000000..eefe4922 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSDate+OSS.h @@ -0,0 +1,19 @@ +// +// NSDate+OSS.h +// AliyunOSSSDK +// +// Created by huaixu on 2018/7/31. +// Copyright © 2018年 aliyun. All rights reserved. +// + +#import + +/** + Categories NSDate + */ +@interface NSDate (OSS) ++ (void)oss_setClockSkew:(NSTimeInterval)clockSkew; ++ (NSDate *)oss_dateFromString:(NSString *)string; ++ (NSDate *)oss_clockSkewFixedDate; +- (NSString *)oss_asStringValue; +@end diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSMutableData+OSS_CRC.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSMutableData+OSS_CRC.h new file mode 100644 index 00000000..a3f76e6e --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSMutableData+OSS_CRC.h @@ -0,0 +1,15 @@ +// +// NSMutableData+OSS_CRC.h +// AliyunOSSSDK +// +// Created by 怀叙 on 2017/11/29. +// Copyright © 2017年 阿里云. All rights reserved. +// + +#import + +@interface NSMutableData (OSS_CRC) + +- (uint64_t)oss_crc64; + +@end diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSMutableDictionary+OSS.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSMutableDictionary+OSS.h new file mode 100644 index 00000000..28cf5f9b --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/NSMutableDictionary+OSS.h @@ -0,0 +1,15 @@ +// +// NSMutableDictionary+OSS.h +// AliyunOSSSDK +// +// Created by huaixu on 2018/8/1. +// Copyright © 2018年 aliyun. All rights reserved. +// + +#import + +@interface NSMutableDictionary (OSS) + +- (void)oss_setObject:(id)anObject forKey:(id )aKey; + +@end diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSAllRequestNeededMessage.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSAllRequestNeededMessage.h new file mode 100644 index 00000000..a9cf9873 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSAllRequestNeededMessage.h @@ -0,0 +1,33 @@ +// +// OSSAllRequestNeededMessage.h +// AliyunOSSSDK +// +// Created by huaixu on 2018/1/22. +// Copyright © 2018年 aliyun. All rights reserved. +// + +#import +#import "OSSConstants.h" +#import "OSSTask.h" + +/** + All necessary information in one OSS request. + */ +@interface OSSAllRequestNeededMessage : NSObject +@property (nonatomic, strong) NSString *endpoint; +@property (nonatomic, strong) NSString *httpMethod; +@property (nonatomic, strong) NSString *bucketName; +@property (nonatomic, strong) NSString *objectKey; +@property (nonatomic, strong) NSString *contentType; +@property (nonatomic, strong) NSString *contentMd5; +@property (nonatomic, strong) NSString *range; +@property (nonatomic, strong) NSString *date; +@property (nonatomic, strong) NSMutableDictionary *headerParams; +@property (nonatomic, copy) NSDictionary *params; +@property (nonatomic, copy) NSString *contentSHA1; +@property (nonatomic, assign) BOOL isHostInCnameExcludeList; + + +- (OSSTask *)validateRequestParamsInOperationType:(OSSOperationType)operType; + +@end diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSBolts.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSBolts.h new file mode 100644 index 00000000..d8b0abe3 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSBolts.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +#import "OSSCancellationToken.h" +#import "OSSCancellationTokenRegistration.h" +#import "OSSCancellationTokenSource.h" +#import "OSSExecutor.h" +#import "OSSTask.h" +#import "OSSTaskCompletionSource.h" + + +NS_ASSUME_NONNULL_BEGIN + +/** + A string containing the version of the Bolts Framework used by the current application. + */ +extern NSString *const OSSBoltsFrameworkVersionString; + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationToken.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationToken.h new file mode 100644 index 00000000..ecf31b68 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationToken.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +#import + +#import "OSSCancellationTokenRegistration.h" + +NS_ASSUME_NONNULL_BEGIN + +/*! + A block that will be called when a token is cancelled. + */ +typedef void(^OSSCancellationBlock)(void); + +/*! + The consumer view of a CancellationToken. + Propagates notification that operations should be canceled. + A OSSCancellationToken has methods to inspect whether the token has been cancelled. + */ +@interface OSSCancellationToken : NSObject + +/*! + Whether cancellation has been requested for this token source. + */ +@property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; + +/*! + Register a block to be notified when the token is cancelled. + If the token is already cancelled the delegate will be notified immediately. + */ +- (OSSCancellationTokenRegistration *)registerCancellationObserverWithBlock:(OSSCancellationBlock)block; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationTokenRegistration.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationTokenRegistration.h new file mode 100644 index 00000000..6649a7fc --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationTokenRegistration.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/*! + Represents the registration of a cancellation observer with a cancellation token. + Can be used to unregister the observer at a later time. + */ +@interface OSSCancellationTokenRegistration : NSObject + +/*! + Removes the cancellation observer registered with the token + and releases all resources associated with this registration. + */ +- (void)dispose; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationTokenSource.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationTokenSource.h new file mode 100644 index 00000000..acb2d084 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCancellationTokenSource.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class OSSCancellationToken; + +/*! + OSSCancellationTokenSource represents the producer side of a CancellationToken. + Signals to a CancellationToken that it should be canceled. + It is a cancellation token that also has methods + for changing the state of a token by cancelling it. + */ +@interface OSSCancellationTokenSource : NSObject + +/*! + Creates a new cancellation token source. + */ ++ (instancetype)cancellationTokenSource; + +/*! + The cancellation token associated with this CancellationTokenSource. + */ +@property (nonatomic, strong, readonly) OSSCancellationToken *token; + +/*! + Whether cancellation has been requested for this token source. + */ +@property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; + +/*! + Cancels the token if it has not already been cancelled. + */ +- (void)cancel; + +/*! + Schedules a cancel operation on this CancellationTokenSource after the specified number of milliseconds. + @param millis The number of milliseconds to wait before completing the returned task. + If delay is `0` the cancel is executed immediately. If delay is `-1` any scheduled cancellation is stopped. + */ +- (void)cancelAfterDelay:(int)millis; + +/*! + Releases all resources associated with this token source, + including disposing of all registrations. + */ +- (void)dispose; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSClient.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSClient.h new file mode 100644 index 00000000..ac9a8534 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSClient.h @@ -0,0 +1,445 @@ +// +// OSSClient.h +// oss_ios_sdk +// +// Created by zhouzhuo on 8/16/15. +// Copyright (c) 2015 aliyun.com. All rights reserved. +// + +#import +@class OSSGetServiceRequest; +@class OSSCreateBucketRequest; +@class OSSDeleteBucketRequest; +@class OSSHeadObjectRequest; +@class OSSGetBucketRequest; +@class OSSGetBucketACLRequest; +@class OSSGetObjectRequest; +@class OSSGetObjectACLRequest; +@class OSSPutObjectRequest; +@class OSSPutObjectACLRequest; +@class OSSDeleteObjectRequest; +@class OSSDeleteMultipleObjectsRequest; +@class OSSCopyObjectRequest; +@class OSSInitMultipartUploadRequest; +@class OSSUploadPartRequest; +@class OSSCompleteMultipartUploadRequest; +@class OSSListPartsRequest; +@class OSSListMultipartUploadsRequest; +@class OSSAbortMultipartUploadRequest; +@class OSSAppendObjectRequest; +@class OSSResumableUploadRequest; +@class OSSMultipartUploadRequest; +@class OSSCallBackRequest; +@class OSSImagePersistRequest; +@class OSSGetBucketInfoRequest; +@class OSSPutSymlinkRequest; +@class OSSGetSymlinkRequest; +@class OSSRestoreObjectRequest; + +@class OSSTask; +@class OSSExecutor; +@class OSSNetworking; +@class OSSClientConfiguration; +@protocol OSSCredentialProvider; + +NS_ASSUME_NONNULL_BEGIN + +/** + OSSClient is the entry class to access OSS in an iOS client. It provides all the methods to communicate with OSS. + Generally speaking, only one instance of OSSClient is needed in the whole app. + */ +@interface OSSClient : NSObject + +/** + OSS endpoint. It varies in different regions. Please check out OSS official website for the exact endpoints for your data. + */ +@property (nonatomic, strong) NSString * endpoint; + +/** + The networking instance for sending and receiving data + */ +@property (nonatomic, strong) OSSNetworking * networking; + +/** + The credential provider instance + */ +@property (nonatomic, strong) id credentialProvider; + +/** + Client configuration instance + */ +@property (nonatomic, strong) OSSClientConfiguration * clientConfiguration; + +/** + oss operation task queue + */ +@property (nonatomic, strong, readonly) OSSExecutor * ossOperationExecutor; + +/** + Initializes an OSSClient instance with the default client configuration. + @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy. + For example: "https://oss-cn-hangzhou.aliyuncs.com" + @credentialProvider The credential provider + */ +- (instancetype)initWithEndpoint:(NSString *)endpoint + credentialProvider:(id) credentialProvider; + +/** + Initializes an OSSClient with the custom client configuration. + @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy. + For example: "https://oss-cn-hangzhou.aliyuncs.com" + @credentialProvider The credential provider + @conf The custom client configuration such as retry time, timeout values, etc. + */ +- (instancetype)initWithEndpoint:(NSString *)endpoint + credentialProvider:(id)credentialProvider + clientConfiguration:(OSSClientConfiguration *)conf; + +#pragma mark restful-api + +/** + The corresponding RESTFul API: GetService + Gets all the buckets of the current user + Notes: + 1. STS is not supported yet in this call. + 2. When all buckets are returned, the xml in response body does not have nodes of Prefix, Marker, MaxKeys, IsTruncated and NextMarker. + If there're remaining buckets to return, the xml will have these nodes. The nextMarker is the value of marker in the next call. + */ +- (OSSTask *)getService:(OSSGetServiceRequest *)request; + +@end + + +@interface OSSClient (Bucket) + +/** + The corresponding RESTFul API: PutBucket + Creates a bucket--it does not support anonymous access. By default, the datacenter used is oss-cn-hangzhou. + Callers could explicitly specify the datacenter for the bucket to optimize the performance and cost or meet the regulation requirement. + Notes: + 1. STS is not supported yet. + */ +- (OSSTask *)createBucket:(OSSCreateBucketRequest *)request; + +/** + The corresponding RESTFul API: DeleteBucket + Deletes a bucket. + */ +- (OSSTask *)deleteBucket:(OSSDeleteBucketRequest *)request; + +/** + The corresponding RESTFul API: GetBucket + Lists all objects in a bucket. It could be specified with filters such as prefix, marker, delimeter and max-keys. + */ +- (OSSTask *)getBucket:(OSSGetBucketRequest *)request; + +/** + The corresponding RESTFul API: GetBucketInfo + Gets the {@link Bucket}'s basic information as well as its ACL. + */ +- (OSSTask *)getBucketInfo:(OSSGetBucketInfoRequest *)request; + +/** + The corresponding RESTFul API: GetBucketACL + Gets the bucket ACL. + */ +- (OSSTask *)getBucketACL:(OSSGetBucketACLRequest *)request; + +@end + + +@interface OSSClient (Object) + +/** + The corresponding RESTFul API: HeadObject + Gets the object's metadata information. The object's content is not returned. + */ +- (OSSTask *)headObject:(OSSHeadObjectRequest *)request; + +/** + The corresponding RESTFul API: GetObject + Gets the whole object (includes content). It requires caller have read permission on the object. + */ +- (OSSTask *)getObject:(OSSGetObjectRequest *)request; + +/** + The corresponding RESTFul API: GetObjectACL + get the acl of an object. + */ +- (OSSTask *)getObjectACL:(OSSGetObjectACLRequest *)request; + +/** + The corresponding RESTFul API: PutObject + Uploads a file. + */ +- (OSSTask *)putObject:(OSSPutObjectRequest *)request; + +/** + Sets the object's ACL. Right now an object has three access permissions: private, public-ready, public-read-write. + The operation specifies the x-oss-object-acl header in the put request. The caller must be the owner of the object. + If succeeds, it returns HTTP status 200; otherwise it returns related error code and error messages. + */ +- (OSSTask *)putObjectACL:(OSSPutObjectACLRequest *)request; + +/** + The corresponding RESTFul API: AppendObject + Appends data to an existing or non-existing object. The object created by this operation is appendable. + As a comparison, the object created by Put Object is normal (non-appendable). + */ +- (OSSTask *)appendObject:(OSSAppendObjectRequest *)request; + +/** + * @brief Appends data to an existing or non-existing object on the OSS server. + * The object created by this operation is appendable. + * @request request + * @crc64ecma crc64ecma + * if object has been stored on OSS server, you need to invoke headObject + * api get object's crc64ecma,then use this api to append data to the + * object. + */ +- (OSSTask *)appendObject:(OSSAppendObjectRequest *)request withCrc64ecma:(nullable NSString *)crc64ecma; + +/** + The corresponding RESTFul API: copyObject + Copies an existing object to another one.The operation sends a PUT request with x-oss-copy-source header to specify the source object. + OSS server side will detect and copy the object. If it succeeds, the new object's metadata information will be returned. + The operation applies for files less than 1GB. For big files, use UploadPartCopy RESTFul API. + */ +- (OSSTask *)copyObject:(OSSCopyObjectRequest *)request; + +/** + * Batch deletes the specified files under a specific bucket. If the files + * are non-exist, the operation will still return successful. + * + * @param request + * A OSSDeleteMultipleObjectsRequest instance which specifies the + * bucket and file keys to delete. + * @return A OSSTask with result of OSSDeleteMultipleObjectsResult instance which specifies each + * file's result in normal mode or only failed deletions in quite + * mode. By default it's quite mode. + */ +- (OSSTask *)deleteMultipleObjects:(OSSDeleteMultipleObjectsRequest *)request; + +/** + The corresponding RESTFul API: DeleteObject + Deletes an object + */ +- (OSSTask *)deleteObject:(OSSDeleteObjectRequest *)request; + +/** + * Creates a symbol link to a target file under the bucket---this is not + * supported for archive class bucket. + * + * @param request + * A OSSPutSymlinkRequest instance that specifies the + * bucket name, symlink name. + * @return An instance of OSSTask. On successful execution, `task.result` will + * contain an instance of `OSSPutSymlinkResult`,otherwise will contain + * an instance of NSError. + * + * for more information,please refer to https://help.aliyun.com/document_detail/45126.html + */ +- (OSSTask *)putSymlink:(OSSPutSymlinkRequest *)request; + +/** + * Gets the symlink information for the given symlink name. + * + * @param request + * A OSSGetSymlinkRequest instance which specifies the bucket + * name and symlink name. + * @return An instance of OSSTask. On successful execution, `task.result` will + * contain an instance of `OSSGetSymlinkResult`,otherwise will contain + * an instance of NSError. + * + * for more information,please refer to https://help.aliyun.com/document_detail/45146.html + */ +- (OSSTask *)getSymlink:(OSSGetSymlinkRequest *)request; + +/** + * Restores the object of archive storage. The function is not applicable to + * Normal or IA storage. The restoreObject() needs to be called prior to + * calling getObject() on an archive object. + * + * @param request + * A container for the necessary parameters to execute the RestoreObject + * service method. + * + * @return An instance of OSSTask. On successful execution, `task.result` will + * contain an instance of `OSSRestoreObjectResult`,otherwise will contain + * an instance of NSError. + * + * for more information,please refer to https://help.aliyun.com/document_detail/52930.html + */ +- (OSSTask *)restoreObject:(OSSRestoreObjectRequest *)request; + +@end + +@interface OSSClient (MultipartUpload) + +/** + The corresponding RESTFul API: InitiateMultipartUpload + Initiates a multipart upload to get a upload Id. It's needed before starting uploading parts data. + The upload Id is used for subsequential operations such as aborting the upload, querying the uploaded parts, etc. + */ +- (OSSTask *)multipartUploadInit:(OSSInitMultipartUploadRequest *)request; + +/** + The corresponding RESTFul API: UploadPart + After the multipart upload is initiated, this API could be called to upload the data to the target file with the upload Id. + Every uploaded part has a unique id called part number, which ranges from 1 to 10,000. + For a given upload Id, the part number identifies the specific range of the data in the whole file. + If the same part number is used for another upload, the existing data will be overwritten by the new upload. + Except the last part, all other part's minimal size is 100KB. + But no minimal size requirement on the last part. + */ +- (OSSTask *)uploadPart:(OSSUploadPartRequest *)request; + +/** + The corresponding RESTFul API: CompleteMultipartUpload + This API is to complete the multipart upload after all parts data have been uploaded. + It must be provided with a valid part list (each part has the part number and ETag). + OSS will validate every part and then complete the multipart upload. + If any part is invalid (e.g. the part is updated by another part upload), this API will fail. + */ +- (OSSTask *)completeMultipartUpload:(OSSCompleteMultipartUploadRequest *)request; + +/** + The corresponding RESTFul API: ListParts + Lists all uploaded parts of the specified upload id. + */ +- (OSSTask *)listParts:(OSSListPartsRequest *)request; + +/** + The corresponding RESTFul API: ListMultipartUploads + Lists all multipart uploads with the specified bucket. + */ +- (OSSTask *)listMultipartUploads:(OSSListMultipartUploadsRequest *)request; + +/** + The corresponding RESTFul API: AbortMultipartUpload + Aborts the multipart upload by the specified upload Id. + Once the multipart upload is aborted by this API, all parts data will be deleted and the upload Id is invalid anymore. + */ +- (OSSTask *)abortMultipartUpload:(OSSAbortMultipartUploadRequest *)request; + +- (OSSTask *)abortResumableMultipartUpload:(OSSResumableUploadRequest *)request; + +/** + Multipart upload API + */ +- (OSSTask *)multipartUpload:(OSSMultipartUploadRequest *)request; +/** + TODOTODO + Resumable upload API + This API wraps the multipart upload and also enables resuming upload by reading/writing the checkpoint data. + For a new file, multipartUploadInit() needs to be called first to get the upload Id. Then use this upload id to call this API to upload the data. + If the upload fails, checks the error messages: + If it's a recoverable error, then call this API again with the same upload Id to retry. The uploaded data will not be uploaded again. + Otherwise then you may need to recreates a new upload Id and call this method again. + Check out demo for the detail. + */ +- (OSSTask *)resumableUpload:(OSSResumableUploadRequest *)request; + +/** + * multipart upload sequentially in order,support resume upload + */ +- (OSSTask *)sequentialMultipartUpload:(OSSResumableUploadRequest *)request; + +@end + + +@interface OSSClient (PresignURL) + +/** + Generates a signed URL for the object and anyone has this URL will get the GET permission on the object. + @bucketName object's bucket name + @objectKey Object name + @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object. + */ +- (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName + withObjectKey:(NSString *)objectKey + withExpirationInterval:(NSTimeInterval)interval; + +/** + Generates a signed URL for the object and anyone has this URL will get the specified permission on the object. + @bucketName object's bucket name + @objectKey Object name + @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object. + @parameter it could specify allowed HTTP methods + */ +- (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName + withObjectKey:(NSString *)objectKey + withExpirationInterval:(NSTimeInterval)interval + withParameters:(NSDictionary *)parameters; + +/** + Generates a signed URL for the object and anyone has this URL will get the specified permission on the object. currently only support get and head method. + @bucketName object's bucket name + @objectKey Object name + @httpMethod http method.currently only support get and head. + @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object. + @parameter it could specify allowed HTTP methods + */ +- (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName + withObjectKey:(NSString *)objectKey + httpMethod:(NSString *)method + withExpirationInterval:(NSTimeInterval)interval + withParameters:(NSDictionary *)parameters; + +/** + If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing. + @bucketName Object's bucket name + @objectKey Object name + */ +- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName + withObjectKey:(NSString *)objectKey; + +/** TODOTODO + If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing. + @bucketName Object's bucket name + @objectKey Object name + @parameter the request parameters. + */ +- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName + withObjectKey:(NSString *)objectKey + withParameters:(NSDictionary *)parameters; + +@end + + +@interface OSSClient (ImageService) + +/* + * image persist action + * https://help.aliyun.com/document_detail/55811.html + */ +- (OSSTask *)imageActionPersist:(OSSImagePersistRequest *)request; + +@end + + +@interface OSSClient (Utilities) + +/** + Checks if the object exists + @bucketName Object's bucket name + @objectKey Object name + + return YES Object exists + return NO && *error = nil Object does not exist + return NO && *error != nil Error occured. + */ +- (BOOL)doesObjectExistInBucket:(NSString *)bucketName + objectKey:(NSString *)objectKey + error:(const NSError **)error; + +@end + + +@interface OSSClient (Callback) + +- (OSSTask *)triggerCallBack:(OSSCallBackRequest *)request; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCocoaLumberjack.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCocoaLumberjack.h new file mode 100644 index 00000000..590d2c1f --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCocoaLumberjack.h @@ -0,0 +1,75 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2016, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +/** + * Welcome to CocoaLumberjack! + * + * The project page has a wealth of documentation if you have any questions. + * + * If you're new to the project you may wish to read "Getting Started" at: + * Documentation/GettingStarted.md + * + * Otherwise, here is a quick refresher. + * There are three steps to using the macros: + * + * Step 1: + * Import the header in your implementation or prefix file: + * + * #import + * + * Step 2: + * Define your logging level in your implementation file: + * + * // Log levels: off, error, warn, info, verbose + * static const DDLogLevel ddLogLevel = DDLogLevelVerbose; + * + * Step 2 [3rd party frameworks]: + * + * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: + * + * // #undef LOG_LEVEL_DEF // Undefine first only if needed + * #define LOG_LEVEL_DEF myLibLogLevel + * + * Define your logging level in your implementation file: + * + * // Log levels: off, error, warn, info, verbose + * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose; + * + * Step 3: + * Replace your NSLog statements with DDLog statements according to the severity of the message. + * + * NSLog(@"Fatal error, no dohickey found!"); -> OSSLogError(@"Fatal error, no dohickey found!"); + * + * DDLog works exactly the same as NSLog. + * This means you can pass it multiple variables just like NSLog. + **/ + +#import + +// Disable legacy macros +#ifndef OSSDD_LEGACY_MACROS + #define OSSDD_LEGACY_MACROS 0 +#endif + +// Core +#import "OSSDDLog.h" + +// Main macros +#import "OSSLogMacros.h" + +// Loggers +#import "OSSFileLogger.h" +#import "OSSNSLogger.h" + diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCompat.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCompat.h new file mode 100644 index 00000000..75eebae4 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSCompat.h @@ -0,0 +1,85 @@ +// +// OSSCompat.h +// oss_ios_sdk_new +// +// Created by zhouzhuo on 9/10/15. +// Copyright (c) 2015 aliyun.com. All rights reserved. +// + +#import +#import "OSSService.h" + +@class OSSCancellationTokenSource; + +typedef OSSCancellationTokenSource OSSTaskHandler; + +NS_ASSUME_NONNULL_BEGIN + +@interface OSSClient (Compat) + +/** + The old version's upload API. + Please use putObject instead. + */ +- (OSSTaskHandler *)uploadData:(NSData *)data + withContentType:(NSString *)contentType + withObjectMeta:(NSDictionary *)meta + toBucketName:(NSString *)bucketName + toObjectKey:(NSString *)objectKey + onCompleted:(void(^)(BOOL, NSError *))onCompleted + onProgress:(void(^)(float progress))onProgress; + +/** + The old version's download API. + Please use getObject instead. + */ +- (OSSTaskHandler *)downloadToDataFromBucket:(NSString *)bucketName + objectKey:(NSString *)objectKey + onCompleted:(void(^)(NSData *, NSError *))onCompleted + onProgress:(void(^)(float progress))onProgress; + +/** + The old version's upload API. + Please use putObject instead. + */ +- (OSSTaskHandler *)uploadFile:(NSString *)filePath + withContentType:(NSString *)contentType + withObjectMeta:(NSDictionary *)meta + toBucketName:(NSString *)bucketName + toObjectKey:(NSString *)objectKey + onCompleted:(void(^)(BOOL, NSError *))onCompleted + onProgress:(void(^)(float progress))onProgress; + +/** + The old version's download API. + Please use getObject instead. + */ +- (OSSTaskHandler *)downloadToFileFromBucket:(NSString *)bucketName + objectKey:(NSString *)objectKey + toFile:(NSString *)filePath + onCompleted:(void(^)(BOOL, NSError *))onCompleted + onProgress:(void(^)(float progress))onProgress; + + +/** + The old version's upload API with resumable upload support. + Please use resumableUpload instead. + */ +- (OSSTaskHandler *)resumableUploadFile:(NSString *)filePath + withContentType:(NSString *)contentType + withObjectMeta:(NSDictionary *)meta + toBucketName:(NSString *)bucketName + toObjectKey:(NSString *)objectKey + onCompleted:(void(^)(BOOL, NSError *))onCompleted + onProgress:(void(^)(float progress))onProgress; + +/** + The old version's delete API. + Please use deleteObject instead. + */ +- (void)deleteObjectInBucket:(NSString *)bucketName + objectKey:(NSString *)objectKey + onCompleted:(void(^)(BOOL, NSError *))onCompleted; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSConstants.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSConstants.h new file mode 100644 index 00000000..aa044c7b --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSConstants.h @@ -0,0 +1,129 @@ +// +// OSSConstants.h +// AliyunOSSSDK +// +// Created by huaixu on 2018/1/22. +// Copyright © 2018年 aliyun. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NSString* _Nullable (^OSSCustomSignContentBlock) (NSString * contentToSign, NSError **error); +typedef NSData * _Nullable (^OSSResponseDecoderBlock) (NSData * data); + +typedef void (^OSSNetworkingUploadProgressBlock) (int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend); +typedef void (^OSSNetworkingDownloadProgressBlock) (int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite); +typedef void (^OSSNetworkingRetryBlock) (void); +typedef void (^OSSNetworkingCompletionHandlerBlock) (id _Nullable responseObject, NSError * _Nullable error); +typedef void (^OSSNetworkingOnRecieveDataBlock) (NSData * data); + +/** + The flag of verification about crc64 + */ +typedef NS_ENUM(NSUInteger, OSSRequestCRCFlag) { + OSSRequestCRCUninitialized, + OSSRequestCRCOpen, + OSSRequestCRCClosed +}; + +/** + Retry type definition + */ +typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) { + OSSNetworkingRetryTypeUnknown, + OSSNetworkingRetryTypeShouldRetry, + OSSNetworkingRetryTypeShouldNotRetry, + OSSNetworkingRetryTypeShouldRefreshCredentialsAndRetry, + OSSNetworkingRetryTypeShouldCorrectClockSkewAndRetry +}; + +/** + * @brief: The following constants are provided by OSSNetworking as possible operation types. + */ +typedef NS_ENUM(NSInteger, OSSOperationType) { + OSSOperationTypeGetService, + OSSOperationTypeCreateBucket, + OSSOperationTypeDeleteBucket, + OSSOperationTypeGetBucket, + OSSOperationTypeGetBucketInfo, + OSSOperationTypeGetBucketACL, + OSSOperationTypeHeadObject, + OSSOperationTypeGetObject, + OSSOperationTypeGetObjectACL, + OSSOperationTypePutObject, + OSSOperationTypePutObjectACL, + OSSOperationTypeAppendObject, + OSSOperationTypeDeleteObject, + OSSOperationTypeDeleteMultipleObjects, + OSSOperationTypeCopyObject, + OSSOperationTypeInitMultipartUpload, + OSSOperationTypeUploadPart, + OSSOperationTypeCompleteMultipartUpload, + OSSOperationTypeAbortMultipartUpload, + OSSOperationTypeListMultipart, + OSSOperationTypeListMultipartUploads, + OSSOperationTypeTriggerCallBack, + OSSOperationTypeImagePersist, + OSSOperationTypeRestoreObject, + OSSOperationTypePutSymlink, + OSSOperationTypeGetSymlink, +}; + +/** + * @brief: The following constants are provided by OSSClient as possible error codes. + */ +typedef NS_ENUM(NSInteger, OSSClientErrorCODE) { + OSSClientErrorCodeNetworkingFailWithResponseCode0, + OSSClientErrorCodeSignFailed, + OSSClientErrorCodeFileCantWrite, + OSSClientErrorCodeInvalidArgument, + OSSClientErrorCodeNilUploadid, + OSSClientErrorCodeTaskCancelled, + OSSClientErrorCodeNetworkError, + OSSClientErrorCodeInvalidCRC, + OSSClientErrorCodeCannotResumeUpload, + OSSClientErrorCodeExcpetionCatched, + OSSClientErrorCodeNotKnown +}; + +typedef NS_ENUM(NSInteger, OSSXMLDictionaryAttributesMode) +{ + OSSXMLDictionaryAttributesModePrefixed = 0, //default + OSSXMLDictionaryAttributesModeDictionary, + OSSXMLDictionaryAttributesModeUnprefixed, + OSSXMLDictionaryAttributesModeDiscard +}; + + +typedef NS_ENUM(NSInteger, OSSXMLDictionaryNodeNameMode) +{ + OSSXMLDictionaryNodeNameModeRootOnly = 0, //default + OSSXMLDictionaryNodeNameModeAlways, + OSSXMLDictionaryNodeNameModeNever +}; + +typedef NS_ENUM(NSInteger, OSSBucketStorageClass) +{ + OSSBucketStorageClassStandard, + OSSBucketStorageClassIA, + OSSBucketStorageClassArchive +}; + +typedef NSString * OSSXMLDictionaryAttributeName NS_EXTENSIBLE_STRING_ENUM; + +OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributesKey; +OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryCommentsKey; +OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryTextKey; +OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryNodeNameKey; +OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributePrefix; + +OBJC_EXTERN NSString * const OSSHTTPMethodHEAD; +OBJC_EXTERN NSString * const OSSHTTPMethodGET; +OBJC_EXTERN NSString * const OSSHTTPMethodPUT; +OBJC_EXTERN NSString * const OSSHTTPMethodPOST; +OBJC_EXTERN NSString * const OSSHTTPMethodDELETE; + + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDDLog.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDDLog.h new file mode 100644 index 00000000..c5dfde9a --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDDLog.h @@ -0,0 +1,860 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2016, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +// Enable 1.9.x legacy macros if imported directly +#ifndef OSSDD_LEGACY_MACROS + #define OSSDD_LEGACY_MACROS 1 +#endif + +#if OS_OBJECT_USE_OBJC + #define DISPATCH_QUEUE_REFERENCE_TYPE strong +#else + #define DISPATCH_QUEUE_REFERENCE_TYPE assign +#endif + +@class OSSDDLogMessage; +@class OSSDDLoggerInformation; +@protocol OSSDDLogger; +@protocol OSSDDLogFormatter; + +/** + * Define the standard options. + * + * We default to only 4 levels because it makes it easier for beginners + * to make the transition to a logging framework. + * + * More advanced users may choose to completely customize the levels (and level names) to suite their needs. + * For more information on this see the "Custom Log Levels" page: + * Documentation/CustomLogLevels.md + * + * Advanced users may also notice that we're using a bitmask. + * This is to allow for custom fine grained logging: + * Documentation/FineGrainedLogging.md + * + * -- Flags -- + * + * Typically you will use the LOG_LEVELS (see below), but the flags may be used directly in certain situations. + * For example, say you have a lot of warning log messages, and you wanted to disable them. + * However, you still needed to see your error and info log messages. + * You could accomplish that with the following: + * + * static const DDLogLevel ddLogLevel = DDLogFlagError | DDLogFlagInfo; + * + * When LOG_LEVEL_DEF is defined as ddLogLevel. + * + * Flags may also be consulted when writing custom log formatters, + * as the DDLogMessage class captures the individual flag that caused the log message to fire. + * + * -- Levels -- + * + * Log levels are simply the proper bitmask of the flags. + * + * -- Booleans -- + * + * The booleans may be used when your logging code involves more than one line. + * For example: + * + * if (LOG_VERBOSE) { + * for (id sprocket in sprockets) + * DDLogVerbose(@"sprocket: %@", [sprocket description]) + * } + * + * -- Async -- + * + * Defines the default asynchronous options. + * The default philosophy for asynchronous logging is very simple: + * + * Log messages with errors should be executed synchronously. + * After all, an error just occurred. The application could be unstable. + * + * All other log messages, such as debug output, are executed asynchronously. + * After all, if it wasn't an error, then it was just informational output, + * or something the application was easily able to recover from. + * + * -- Changes -- + * + * You are strongly discouraged from modifying this file. + * If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project. + * Instead, create your own MyLogging.h or ApplicationNameLogging.h or CompanyLogging.h + * + * For an example of customizing your logging experience, see the "Custom Log Levels" page: + * Documentation/CustomLogLevels.md + **/ + +/** + * Flags accompany each log. They are used together with levels to filter out logs. + */ +typedef NS_OPTIONS(NSUInteger, OSSDDLogFlag){ + /** + * 0...00001 DDLogFlagError + */ + OSSDDLogFlagError = (1 << 0), + + /** + * 0...00010 DDLogFlagWarning + */ + OSSDDLogFlagWarning = (1 << 1), + + /** + * 0...00100 DDLogFlagInfo + */ + OSSDDLogFlagInfo = (1 << 2), + + /** + * 0...01000 DDLogFlagDebug + */ + OSSDDLogFlagDebug = (1 << 3), + + /** + * 0...10000 DDLogFlagVerbose + */ + OSSDDLogFlagVerbose = (1 << 4) +}; + +/** + * Log levels are used to filter out logs. Used together with flags. + */ +typedef NS_ENUM(NSUInteger, OSSDDLogLevel){ + /** + * No logs + */ + OSSDDLogLevelOff = 0, + + /** + * Error logs only + */ + OSSDDLogLevelError = (OSSDDLogFlagError), + + /** + * Error and warning logs + */ + OSSDDLogLevelWarning = (OSSDDLogLevelError | OSSDDLogFlagWarning), + + /** + * Error, warning and info logs + */ + OSSDDLogLevelInfo = (OSSDDLogLevelWarning | OSSDDLogFlagInfo), + + /** + * Error, warning, info and debug logs + */ + OSSDDLogLevelDebug = (OSSDDLogLevelInfo | OSSDDLogFlagDebug), + + /** + * Error, warning, info, debug and verbose logs + */ + OSSDDLogLevelVerbose = (OSSDDLogLevelDebug | OSSDDLogFlagVerbose), + + /** + * All logs (1...11111) + */ + OSSDDLogLevelAll = NSUIntegerMax +}; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Extracts just the file name, no path or extension + * + * @param filePath input file path + * @param copy YES if we want the result to be copied + * + * @return the file name + */ +NSString * __nullable OSSDDExtractFileNameWithoutExtension(const char *filePath, BOOL copy); + +/** + * The THIS_FILE macro gives you an NSString of the file name. + * For simplicity and clarity, the file name does not include the full path or file extension. + * + * For example: DDLogWarn(@"%@: Unable to find thingy", THIS_FILE) -> @"MyViewController: Unable to find thingy" + **/ +#define THIS_FILE (DDExtractFileNameWithoutExtension(__FILE__, NO)) + +/** + * The THIS_METHOD macro gives you the name of the current objective-c method. + * + * For example: DDLogWarn(@"%@ - Requires non-nil strings", THIS_METHOD) -> @"setMake:model: requires non-nil strings" + * + * Note: This does NOT work in straight C functions (non objective-c). + * Instead you should use the predefined __FUNCTION__ macro. + **/ +#define THIS_METHOD NSStringFromSelector(_cmd) + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * The main class, exposes all logging mechanisms, loggers, ... + * For most of the users, this class is hidden behind the logging functions like `DDLogInfo` + */ +@interface OSSDDLog : NSObject + +/** + * Returns the singleton `DDLog`. + * The instance is used by `DDLog` class methods. + */ +@property (class, nonatomic, strong, readonly) OSSDDLog *sharedInstance; + +/** + * Provides access to the underlying logging queue. + * This may be helpful to Logger classes for things like thread synchronization. + **/ +@property (class, nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggingQueue; + +/** + * Logging Primitive. + * + * This method is used by the macros or logging functions. + * It is suggested you stick with the macros as they're easier to use. + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param level the log level + * @param flag the log flag + * @param context the context (if any is defined) + * @param file the current file + * @param function the current function + * @param line the current code line + * @param tag potential tag + * @param format the log format + */ ++ (void)log:(BOOL)asynchronous + level:(OSSDDLogLevel)level + flag:(OSSDDLogFlag)flag + context:(NSInteger)context + file:(const char *)file + function:(const char *)function + line:(NSUInteger)line + tag:(id __nullable)tag + format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10); + +/** + * Logging Primitive. + * + * This method is used by the macros or logging functions. + * It is suggested you stick with the macros as they're easier to use. + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param level the log level + * @param flag the log flag + * @param context the context (if any is defined) + * @param file the current file + * @param function the current function + * @param line the current code line + * @param tag potential tag + * @param format the log format + */ +- (void)log:(BOOL)asynchronous + level:(OSSDDLogLevel)level + flag:(OSSDDLogFlag)flag + context:(NSInteger)context + file:(const char *)file + function:(const char *)function + line:(NSUInteger)line + tag:(id __nullable)tag + format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10); + +/** + * Logging Primitive. + * + * This method can be used if you have a prepared va_list. + * Similar to `log:level:flag:context:file:function:line:tag:format:...` + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param level the log level + * @param flag the log flag + * @param context the context (if any is defined) + * @param file the current file + * @param function the current function + * @param line the current code line + * @param tag potential tag + * @param format the log format + * @param argList the arguments list as a va_list + */ ++ (void)log:(BOOL)asynchronous + level:(OSSDDLogLevel)level + flag:(OSSDDLogFlag)flag + context:(NSInteger)context + file:(const char *)file + function:(const char *)function + line:(NSUInteger)line + tag:(id __nullable)tag + format:(NSString *)format + args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:)); + +/** + * Logging Primitive. + * + * This method can be used if you have a prepared va_list. + * Similar to `log:level:flag:context:file:function:line:tag:format:...` + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param level the log level + * @param flag the log flag + * @param context the context (if any is defined) + * @param file the current file + * @param function the current function + * @param line the current code line + * @param tag potential tag + * @param format the log format + * @param argList the arguments list as a va_list + */ +- (void)log:(BOOL)asynchronous + level:(OSSDDLogLevel)level + flag:(OSSDDLogFlag)flag + context:(NSInteger)context + file:(const char *)file + function:(const char *)function + line:(NSUInteger)line + tag:(id __nullable)tag + format:(NSString *)format + args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:)); + +/** + * Logging Primitive. + * + * This method can be used if you manualy prepared DDLogMessage. + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param logMessage the log message stored in a `DDLogMessage` model object + */ ++ (void)log:(BOOL)asynchronous + message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:)); + +/** + * Logging Primitive. + * + * This method can be used if you manualy prepared DDLogMessage. + * + * @param asynchronous YES if the logging is done async, NO if you want to force sync + * @param logMessage the log message stored in a `DDLogMessage` model object + */ +- (void)log:(BOOL)asynchronous + message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:)); + +/** + * Since logging can be asynchronous, there may be times when you want to flush the logs. + * The framework invokes this automatically when the application quits. + **/ ++ (void)flushLog; + +/** + * Since logging can be asynchronous, there may be times when you want to flush the logs. + * The framework invokes this automatically when the application quits. + **/ +- (void)flushLog; + +/** + * Loggers + * + * In order for your log statements to go somewhere, you should create and add a logger. + * + * You can add multiple loggers in order to direct your log statements to multiple places. + * And each logger can be configured separately. + * So you could have, for example, verbose logging to the console, but a concise log file with only warnings & errors. + **/ + +/** + * Adds the logger to the system. + * + * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`. + **/ ++ (void)addLogger:(id )logger; + +/** + * Adds the logger to the system. + * + * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`. + **/ +- (void)addLogger:(id )logger; + +/** + * Adds the logger to the system. + * + * The level that you provide here is a preemptive filter (for performance). + * That is, the level specified here will be used to filter out logMessages so that + * the logger is never even invoked for the messages. + * + * More information: + * When you issue a log statement, the logging framework iterates over each logger, + * and checks to see if it should forward the logMessage to the logger. + * This check is done using the level parameter passed to this method. + * + * For example: + * + * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];` + * `[DDLog addLogger:fileLogger withLogLevel:DDLogLevelWarning];` + * + * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger + * `DDLogInfo(@"hi");` => gets forwarded to consoleLogger only + * + * It is important to remember that Lumberjack uses a BITMASK. + * Many developers & third party frameworks may define extra log levels & flags. + * For example: + * + * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000` + * + * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages. + * + * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO` + * + * Consider passing `DDLogLevelAll` to this method, which has all bits set. + * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set, + * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug: + * + * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)` + **/ ++ (void)addLogger:(id )logger withLevel:(OSSDDLogLevel)level; + +/** + * Adds the logger to the system. + * + * The level that you provide here is a preemptive filter (for performance). + * That is, the level specified here will be used to filter out logMessages so that + * the logger is never even invoked for the messages. + * + * More information: + * When you issue a log statement, the logging framework iterates over each logger, + * and checks to see if it should forward the logMessage to the logger. + * This check is done using the level parameter passed to this method. + * + * For example: + * + * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];` + * `[DDLog addLogger:fileLogger withLogLevel:DDLogLevelWarning];` + * + * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger + * `DDLogInfo(@"hi");` => gets forwarded to consoleLogger only + * + * It is important to remember that Lumberjack uses a BITMASK. + * Many developers & third party frameworks may define extra log levels & flags. + * For example: + * + * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000` + * + * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages. + * + * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO` + * + * Consider passing `DDLogLevelAll` to this method, which has all bits set. + * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set, + * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug: + * + * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)` + **/ +- (void)addLogger:(id )logger withLevel:(OSSDDLogLevel)level; + +/** + * Remove the logger from the system + */ ++ (void)removeLogger:(id )logger; + +/** + * Remove the logger from the system + */ +- (void)removeLogger:(id )logger; + +/** + * Remove all the current loggers + */ ++ (void)removeAllLoggers; + +/** + * Remove all the current loggers + */ +- (void)removeAllLoggers; + +/** + * Return all the current loggers + */ +@property (class, nonatomic, copy, readonly) NSArray> *allLoggers; + +/** + * Return all the current loggers + */ +@property (nonatomic, copy, readonly) NSArray> *allLoggers; + +/** + * Return all the current loggers with their level (aka DDLoggerInformation). + */ +@property (class, nonatomic, copy, readonly) NSArray *allLoggersWithLevel; + +/** + * Return all the current loggers with their level (aka DDLoggerInformation). + */ +@property (nonatomic, copy, readonly) NSArray *allLoggersWithLevel; + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * This protocol describes a basic logger behavior. + * Basically, it can log messages, store a logFormatter plus a bunch of optional behaviors. + * (i.e. flush, get its loggerQueue, get its name, ... + */ +@protocol OSSDDLogger + +/** + * The log message method + * + * @param logMessage the message (model) + */ +- (void)logMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(message:)); + +/** + * Formatters may optionally be added to any logger. + * + * If no formatter is set, the logger simply logs the message as it is given in logMessage, + * or it may use its own built in formatting style. + **/ +@property (nonatomic, strong) id logFormatter; + +@optional + +/** + * Since logging is asynchronous, adding and removing loggers is also asynchronous. + * In other words, the loggers are added and removed at appropriate times with regards to log messages. + * + * - Loggers will not receive log messages that were executed prior to when they were added. + * - Loggers will not receive log messages that were executed after they were removed. + * + * These methods are executed in the logging thread/queue. + * This is the same thread/queue that will execute every logMessage: invocation. + * Loggers may use these methods for thread synchronization or other setup/teardown tasks. + **/ +- (void)didAddLogger; + +/** + * Since logging is asynchronous, adding and removing loggers is also asynchronous. + * In other words, the loggers are added and removed at appropriate times with regards to log messages. + * + * - Loggers will not receive log messages that were executed prior to when they were added. + * - Loggers will not receive log messages that were executed after they were removed. + * + * These methods are executed in the logging thread/queue given in parameter. + * This is the same thread/queue that will execute every logMessage: invocation. + * Loggers may use the queue parameter to set specific values on the queue with dispatch_set_specific() function. + **/ +- (void)didAddLoggerInQueue:(dispatch_queue_t)queue; + +/** + * See the above description for `didAddLoger` + */ +- (void)willRemoveLogger; + +/** + * Some loggers may buffer IO for optimization purposes. + * For example, a database logger may only save occasionaly as the disk IO is slow. + * In such loggers, this method should be implemented to flush any pending IO. + * + * This allows invocations of DDLog's flushLog method to be propogated to loggers that need it. + * + * Note that DDLog's flushLog method is invoked automatically when the application quits, + * and it may be also invoked manually by the developer prior to application crashes, or other such reasons. + **/ +- (void)flush; + +/** + * Each logger is executed concurrently with respect to the other loggers. + * Thus, a dedicated dispatch queue is used for each logger. + * Logger implementations may optionally choose to provide their own dispatch queue. + **/ +@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggerQueue; + +/** + * If the logger implementation does not choose to provide its own queue, + * one will automatically be created for it. + * The created queue will receive its name from this method. + * This may be helpful for debugging or profiling reasons. + **/ +@property (nonatomic, readonly) NSString *loggerName; + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * This protocol describes the behavior of a log formatter + */ +@protocol OSSDDLogFormatter +@required + +/** + * Formatters may optionally be added to any logger. + * This allows for increased flexibility in the logging environment. + * For example, log messages for log files may be formatted differently than log messages for the console. + * + * For more information about formatters, see the "Custom Formatters" page: + * Documentation/CustomFormatters.md + * + * The formatter may also optionally filter the log message by returning nil, + * in which case the logger will not log the message. + **/ +- (NSString * __nullable)formatLogMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(format(message:)); + +@optional + +/** + * A single formatter instance can be added to multiple loggers. + * These methods provides hooks to notify the formatter of when it's added/removed. + * + * This is primarily for thread-safety. + * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers. + * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter), + * it could possibly use these hooks to switch to thread-safe versions of the code. + **/ +- (void)didAddToLogger:(id )logger; + +/** + * A single formatter instance can be added to multiple loggers. + * These methods provides hooks to notify the formatter of when it's added/removed. + * + * This is primarily for thread-safety. + * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers. + * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter), + * it could possibly use these hooks to switch to thread-safe versions of the code or use dispatch_set_specific() +.* to add its own specific values. + **/ +- (void)didAddToLogger:(id )logger inQueue:(dispatch_queue_t)queue; + +/** + * See the above description for `didAddToLogger:` + */ +- (void)willRemoveFromLogger:(id )logger; + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * This protocol describes a dynamic logging component + */ +@protocol OSSDDRegisteredDynamicLogging + +/** + * Implement these methods to allow a file's log level to be managed from a central location. + * + * This is useful if you'd like to be able to change log levels for various parts + * of your code from within the running application. + * + * Imagine pulling up the settings for your application, + * and being able to configure the logging level on a per file basis. + * + * The implementation can be very straight-forward: + * + * ``` + * + (int)ddLogLevel + * { + * return ddLogLevel; + * } + * + * + (void)ddSetLogLevel:(DDLogLevel)level + * { + * ddLogLevel = level; + * } + * ``` + **/ +@property (class, nonatomic, readwrite, setter=ddSetLogLevel:) OSSDDLogLevel ossLogLevel; + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef NS_DESIGNATED_INITIALIZER + #define NS_DESIGNATED_INITIALIZER +#endif + +/** + * Log message options, allow copying certain log elements + */ +typedef NS_OPTIONS(NSInteger, OSSDDLogMessageOptions){ + /** + * Use this to use a copy of the file path + */ + OSSDDLogMessageCopyFile = 1 << 0, + /** + * Use this to use a copy of the function name + */ + OSSDDLogMessageCopyFunction = 1 << 1, + /** + * Use this to use avoid a copy of the message + */ + OSSDDLogMessageDontCopyMessage = 1 << 2 +}; + +/** + * The `DDLogMessage` class encapsulates information about the log message. + * If you write custom loggers or formatters, you will be dealing with objects of this class. + **/ +@interface OSSDDLogMessage : NSObject +{ + // Direct accessors to be used only for performance + @public + NSString *_message; + OSSDDLogLevel _level; + OSSDDLogFlag _flag; + NSInteger _context; + NSString *_file; + NSString *_fileName; + NSString *_function; + NSUInteger _line; + id _tag; + OSSDDLogMessageOptions _options; + NSDate *_timestamp; + NSString *_threadID; + NSString *_threadName; + NSString *_queueLabel; +} + +/** + * Default `init` for empty messages. + */ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Standard init method for a log message object. + * Used by the logging primitives. (And the macros use the logging primitives.) + * + * If you find need to manually create logMessage objects, there is one thing you should be aware of: + * + * If no flags are passed, the method expects the file and function parameters to be string literals. + * That is, it expects the given strings to exist for the duration of the object's lifetime, + * and it expects the given strings to be immutable. + * In other words, it does not copy these strings, it simply points to them. + * This is due to the fact that __FILE__ and __FUNCTION__ are usually used to specify these parameters, + * so it makes sense to optimize and skip the unnecessary allocations. + * However, if you need them to be copied you may use the options parameter to specify this. + * + * @param message the message + * @param level the log level + * @param flag the log flag + * @param context the context (if any is defined) + * @param file the current file + * @param function the current function + * @param line the current code line + * @param tag potential tag + * @param options a bitmask which supports DDLogMessageCopyFile and DDLogMessageCopyFunction. + * @param timestamp the log timestamp + * + * @return a new instance of a log message model object + */ +- (instancetype)initWithMessage:(NSString *)message + level:(OSSDDLogLevel)level + flag:(OSSDDLogFlag)flag + context:(NSInteger)context + file:(NSString *)file + function:(NSString * __nullable)function + line:(NSUInteger)line + tag:(id __nullable)tag + options:(OSSDDLogMessageOptions)options + timestamp:(NSDate * __nullable)timestamp NS_DESIGNATED_INITIALIZER; + +/** + * Read-only properties + **/ + +/** + * The log message + */ +@property (readonly, nonatomic) NSString *message; +@property (readonly, nonatomic) OSSDDLogLevel level; +@property (readonly, nonatomic) OSSDDLogFlag flag; +@property (readonly, nonatomic) NSInteger context; +@property (readonly, nonatomic) NSString *file; +@property (readonly, nonatomic) NSString *fileName; +@property (readonly, nonatomic) NSString * __nullable function; +@property (readonly, nonatomic) NSUInteger line; +@property (readonly, nonatomic) id __nullable tag; +@property (readonly, nonatomic) OSSDDLogMessageOptions options; +@property (readonly, nonatomic) NSDate *timestamp; +@property (readonly, nonatomic) NSString *threadID; // ID as it appears in NSLog calculated from the machThreadID +@property (readonly, nonatomic) NSString *threadName; +@property (readonly, nonatomic) NSString *queueLabel; + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * The `DDLogger` protocol specifies that an optional formatter can be added to a logger. + * Most (but not all) loggers will want to support formatters. + * + * However, writting getters and setters in a thread safe manner, + * while still maintaining maximum speed for the logging process, is a difficult task. + * + * To do it right, the implementation of the getter/setter has strict requiremenets: + * - Must NOT require the `logMessage:` method to acquire a lock. + * - Must NOT require the `logMessage:` method to access an atomic property (also a lock of sorts). + * + * To simplify things, an abstract logger is provided that implements the getter and setter. + * + * Logger implementations may simply extend this class, + * and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their `logMessage:` method! + **/ +@interface OSSDDAbstractLogger : NSObject +{ + // Direct accessors to be used only for performance + @public + id _logFormatter; + dispatch_queue_t _loggerQueue; +} + +@property (nonatomic, strong, nullable) id logFormatter; +@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE) dispatch_queue_t loggerQueue; + +// For thread-safety assertions + +/** + * Return YES if the current logger uses a global queue for logging + */ +@property (nonatomic, readonly, getter=isOnGlobalLoggingQueue) BOOL onGlobalLoggingQueue; + +/** + * Return YES if the current logger uses the internal designated queue for logging + */ +@property (nonatomic, readonly, getter=isOnInternalLoggerQueue) BOOL onInternalLoggerQueue; + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +@interface OSSDDLoggerInformation : NSObject + +@property (nonatomic, readonly) id logger; +@property (nonatomic, readonly) OSSDDLogLevel level; + ++ (OSSDDLoggerInformation *)informationWithLogger:(id )logger + andLevel:(OSSDDLogLevel)level; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDefine.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDefine.h new file mode 100644 index 00000000..e90105a2 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDefine.h @@ -0,0 +1,84 @@ +// +// OSSDefine.h +// AliyunOSSiOS +// +// Created by zhouzhuo on 5/1/16. +// Copyright © 2016 zhouzhuo. All rights reserved. +// + +#import + +#ifndef OSSDefine_h +#define OSSDefine_h + +#if TARGET_OS_IOS +#define OSSUAPrefix @"aliyun-sdk-ios" +#elif TARGET_OS_OSX +#define OSSUAPrefix @"aliyun-sdk-mac" +#endif +#define OSSSDKVersion @"2.10.8" + +#define OSSListBucketResultXMLTOKEN @"ListBucketResult" +#define OSSNameXMLTOKEN @"Name" +#define OSSDelimiterXMLTOKEN @"Delimiter" +#define OSSMarkerXMLTOKEN @"Marker" +#define OSSKeyMarkerXMLTOKEN @"KeyMarker" +#define OSSNextMarkerXMLTOKEN @"NextMarker" +#define OSSNextKeyMarkerXMLTOKEN @"NextKeyMarker" +#define OSSUploadIdMarkerXMLTOKEN @"UploadIdMarker" +#define OSSNextUploadIdMarkerXMLTOKEN @"NextUploadIdMarker" +#define OSSMaxKeysXMLTOKEN @"MaxKeys" +#define OSSMaxUploadsXMLTOKEN @"MaxUploads" +#define OSSIsTruncatedXMLTOKEN @"IsTruncated" +#define OSSContentsXMLTOKEN @"Contents" +#define OSSUploadXMLTOKEN @"Upload" +#define OSSKeyXMLTOKEN @"Key" +#define OSSLastModifiedXMLTOKEN @"LastModified" +#define OSSETagXMLTOKEN @"ETag" +#define OSSTypeXMLTOKEN @"Type" +#define OSSSizeXMLTOKEN @"Size" +#define OSSStorageClassXMLTOKEN @"StorageClass" +#define OSSCommonPrefixesXMLTOKEN @"CommonPrefixes" +#define OSSOwnerXMLTOKEN @"Owner" +#define OSSAccessControlListXMLTOKEN @"AccessControlList" +#define OSSGrantXMLTOKEN @"Grant" +#define OSSIDXMLTOKEN @"ID" +#define OSSDisplayNameXMLTOKEN @"DisplayName" +#define OSSBucketsXMLTOKEN @"Buckets" +#define OSSBucketXMLTOKEN @"Bucket" +#define OSSCreationDate @"CreationDate" +#define OSSPrefixXMLTOKEN @"Prefix" +#define OSSUploadIdXMLTOKEN @"UploadId" +#define OSSLocationXMLTOKEN @"Location" +#define OSSNextPartNumberMarkerXMLTOKEN @"NextPartNumberMarker" +#define OSSMaxPartsXMLTOKEN @"MaxParts" +#define OSSPartXMLTOKEN @"Part" +#define OSSPartNumberXMLTOKEN @"PartNumber" + +#define OSSClientErrorDomain @"com.aliyun.oss.clientError" +#define OSSServerErrorDomain @"com.aliyun.oss.serverError" + +#define OSSErrorMessageTOKEN @"ErrorMessage" + +#define OSSHttpHeaderContentDisposition @"Content-Disposition" +#define OSSHttpHeaderXOSSCallback @"x-oss-callback" +#define OSSHttpHeaderXOSSCallbackVar @"x-oss-callback-var" +#define OSSHttpHeaderContentEncoding @"Content-Encoding" +#define OSSHttpHeaderContentType @"Content-Type" +#define OSSHttpHeaderContentMD5 @"Content-MD5" +#define OSSHttpHeaderCacheControl @"Cache-Control" +#define OSSHttpHeaderExpires @"Expires" +#define OSSHttpHeaderHashSHA1 @"x-oss-hash-sha1" +#define OSSHttpHeaderBucketACL @"x-oss-acl" +#define OSSHttpHeaderObjectACL @"x-oss-object-acl" +#define OSSHttpHeaderCopySource @"x-oss-copy-source" +#define OSSHttpHeaderSymlinkTarget @"x-oss-symlink-target" + +#define OSSHttpQueryProcess @"x-oss-process" + +#define OSSDefaultRetryCount 3 +#define OSSDefaultMaxConcurrentNum 5 +#define OSSDefaultTimeoutForRequestInSecond 15 +#define OSSDefaultTimeoutForResourceInSecond 7 * 24 * 60 * 60 + +#endif /* OSSDefine_h */ diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsRequest.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsRequest.h new file mode 100644 index 00000000..28955d36 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsRequest.h @@ -0,0 +1,31 @@ +// +// OSSDeleteMultipleObjectsRequest.h +// AliyunOSSSDK +// +// Created by huaixu on 2018/1/26. +// Copyright © 2018年 aliyun. All rights reserved. +// +#import +#import "OSSRequest.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface OSSDeleteMultipleObjectsRequest : OSSRequest + +@property (nonatomic, copy) NSString *bucketName; + +@property (nonatomic, copy) NSArray *keys; + +/** + invalid value is @"url" + */ +@property (nonatomic, copy, nullable) NSString *encodingType; + +/** + whether to show verbose result,the default value is YES. + */ +@property (nonatomic, assign) BOOL quiet; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsResult.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsResult.h new file mode 100644 index 00000000..4f03e208 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsResult.h @@ -0,0 +1,17 @@ +// +// OSSDeleteMultipleObjectsResult.h +// AliyunOSSSDK +// +// Created by huaixu on 2018/1/26. +// Copyright © 2018年 aliyun. All rights reserved. +// + +#import "OSSResult.h" + +@interface OSSDeleteMultipleObjectsResult : OSSResult + +@property (nonatomic, copy) NSArray *deletedObjects; + +@property (nonatomic, copy) NSString *encodingType; + +@end diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSExecutor.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSExecutor.h new file mode 100644 index 00000000..40c9ef46 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSExecutor.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/*! + An object that can run a given block. + */ +@interface OSSExecutor : NSObject + +/*! + Returns a default executor, which runs continuations immediately until the call stack gets too + deep, then dispatches to a new GCD queue. + */ ++ (instancetype)defaultExecutor; + +/*! + Returns an executor that runs continuations on the thread where the previous task was completed. + */ ++ (instancetype)immediateExecutor; + +/*! + Returns an executor that runs continuations on the main thread. + */ ++ (instancetype)mainThreadExecutor; + +/*! + Returns a new executor that uses the given block to execute continuations. + @param block The block to use. + */ ++ (instancetype)executorWithBlock:(void(^)(void(^block)(void)))block; + +/*! + Returns a new executor that runs continuations on the given queue. + @param queue The instance of `dispatch_queue_t` to dispatch all continuations onto. + */ ++ (instancetype)executorWithDispatchQueue:(dispatch_queue_t)queue; + +/*! + Returns a new executor that runs continuations on the given queue. + @param queue The instance of `NSOperationQueue` to run all continuations on. + */ ++ (instancetype)executorWithOperationQueue:(NSOperationQueue *)queue; + +/*! + Runs the given block using this executor's particular strategy. + @param block The block to execute. + */ +- (void)execute:(void(^)(void))block; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSFileLogger.h b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSFileLogger.h new file mode 100644 index 00000000..bb87d604 --- /dev/null +++ b/xplan-ios/Library/RPSDK/AliyunOSSiOS.framework/Headers/OSSFileLogger.h @@ -0,0 +1,509 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2016, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import "OSSDDLog.h" + +@class OSSDDLogFileInfo; + +/** + * This class provides a logger to write log statements to a file. + **/ + + +// Default configuration and safety/sanity values. +// +// maximumFileSize -> kDDDefaultLogMaxFileSize +// rollingFrequency -> kDDDefaultLogRollingFrequency +// maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles +// logFilesDiskQuota -> kDDDefaultLogFilesDiskQuota +// +// You should carefully consider the proper configuration values for your application. + +extern unsigned long long const osskDDDefaultLogMaxFileSize; +extern NSTimeInterval const osskDDDefaultLogRollingFrequency; +extern NSUInteger const osskDDDefaultLogMaxNumLogFiles; +extern unsigned long long const osskDDDefaultLogFilesDiskQuota; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * The LogFileManager protocol is designed to allow you to control all aspects of your log files. + * + * The primary purpose of this is to allow you to do something with the log files after they have been rolled. + * Perhaps you want to compress them to save disk space. + * Perhaps you want to upload them to an FTP server. + * Perhaps you want to run some analytics on the file. + * + * A default LogFileManager is, of course, provided. + * The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property. + * + * This protocol provides various methods to fetch the list of log files. + * + * There are two variants: sorted and unsorted. + * If sorting is not necessary, the unsorted variant is obviously faster. + * The sorted variant will return an array sorted by when the log files were created, + * with the most recently created log file at index 0, and the oldest log file at the end of the array. + * + * You can fetch only the log file paths (full path including name), log file names (name only), + * or an array of `DDLogFileInfo` objects. + * The `DDLogFileInfo` class is documented below, and provides a handy wrapper that + * gives you easy access to various file attributes such as the creation date or the file size. + */ +@protocol OSSDDLogFileManager +@required + +// Public properties + +/** + * The maximum number of archived log files to keep on disk. + * For example, if this property is set to 3, + * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk. + * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted. + * + * You may optionally disable this option by setting it to zero. + **/ +@property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles; + +/** + * The maximum space that logs can take. On rolling logfile all old logfiles that exceed logFilesDiskQuota will + * be deleted. + * + * You may optionally disable this option by setting it to zero. + **/ +@property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota; + +// Public methods + +/** + * Returns the logs directory (path) + */ +@property (nonatomic, readonly, copy) NSString *logsDirectory; + +/** + * Returns an array of `NSString` objects, + * each of which is the filePath to an existing log file on disk. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFilePaths; + +/** + * Returns an array of `NSString` objects, + * each of which is the fileName of an existing log file on disk. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileNames; + +/** + * Returns an array of `DDLogFileInfo` objects, + * each representing an existing log file on disk, + * and containing important information about the log file such as it's modification date and size. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileInfos; + +/** + * Just like the `unsortedLogFilePaths` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFilePaths; + +/** + * Just like the `unsortedLogFileNames` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFileNames; + +/** + * Just like the `unsortedLogFileInfos` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFileInfos; + +// Private methods (only to be used by DDFileLogger) + +/** + * Generates a new unique log file path, and creates the corresponding log file. + **/ +- (NSString *)createNewLogFile; + +@optional + +// Notifications from DDFileLogger + +/** + * Called when a log file was archieved + */ +- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:)); + +/** + * Called when the roll action was executed and the log was archieved + */ +- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:)); + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * Default log file manager. + * + * All log files are placed inside the logsDirectory. + * If a specific logsDirectory isn't specified, the default directory is used. + * On Mac, this is in `~/Library/Logs/`. + * On iPhone, this is in `~/Library/Caches/Logs`. + * + * Log files are named `"