No Description

AWSCategory.h 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //
  2. // Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License").
  5. // You may not use this file except in compliance with the License.
  6. // A copy of the License is located at
  7. //
  8. // http://aws.amazon.com/apache2.0
  9. //
  10. // or in the "license" file accompanying this file. This file is distributed
  11. // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. // express or implied. See the License for the specific language governing
  13. // permissions and limitations under the License.
  14. //
  15. #import <Foundation/Foundation.h>
  16. #import "AWSServiceEnum.h"
  17. FOUNDATION_EXPORT NSString *const AWSDateRFC822DateFormat1;
  18. FOUNDATION_EXPORT NSString *const AWSDateISO8601DateFormat1;
  19. FOUNDATION_EXPORT NSString *const AWSDateISO8601DateFormat2;
  20. FOUNDATION_EXPORT NSString *const AWSDateISO8601DateFormat3;
  21. FOUNDATION_EXPORT NSString *const AWSDateShortDateFormat1;
  22. FOUNDATION_EXPORT NSString *const AWSDateShortDateFormat2;
  23. @interface NSDate (AWS)
  24. + (NSDate *)aws_clockSkewFixedDate;
  25. + (NSDate *)aws_dateFromString:(NSString *)string;
  26. + (NSDate *)aws_dateFromString:(NSString *)string format:(NSString *)dateFormat;
  27. - (NSString *)aws_stringValue:(NSString *)dateFormat;
  28. /**
  29. * Set the clock skew for the current device. This clock skew will be used for calculating
  30. * signatures to AWS signatures and for parsing/converting date values from responses.
  31. *
  32. * @param clockskew the skew (in seconds) for this device. If the clock on the device is fast, pass positive skew to correct. If the clock on the device is slow, pass negative skew to correct.
  33. */
  34. + (void)aws_setRuntimeClockSkew:(NSTimeInterval)clockskew;
  35. /**
  36. * Get the clock skew for the current device.
  37. *
  38. * @return the skew (in seconds) currently set for this device. Positive clock skew implies the device is fast, negative implies the device is slow.
  39. */
  40. + (NSTimeInterval)aws_getRuntimeClockSkew;
  41. @end
  42. @interface NSDictionary (AWS)
  43. - (NSDictionary *)aws_removeNullValues;
  44. - (id)aws_objectForCaseInsensitiveKey:(id)aKey;
  45. @end
  46. @interface NSJSONSerialization (AWS)
  47. + (NSData *)aws_dataWithJSONObject:(id)obj
  48. options:(NSJSONWritingOptions)opt
  49. error:(NSError **)error;
  50. @end
  51. @interface NSNumber (AWS)
  52. + (NSNumber *)aws_numberFromString:(NSString *)string;
  53. @end
  54. @interface NSObject (AWS)
  55. - (NSDictionary *)aws_properties;
  56. - (void)aws_copyPropertiesFromObject:(NSObject *)object;
  57. @end
  58. @interface NSString (AWS)
  59. + (NSString *)aws_base64md5FromData:(NSData *)data;
  60. - (BOOL)aws_isBase64Data;
  61. - (NSString *)aws_stringWithURLEncoding;
  62. - (NSString *)aws_stringWithURLEncodingPath;
  63. - (NSString *)aws_stringWithURLEncodingPathWithoutPriorDecoding;
  64. - (NSString *)aws_md5String;
  65. - (NSString *)aws_md5StringLittleEndian;
  66. - (BOOL)aws_isVirtualHostedStyleCompliant;
  67. - (AWSRegionType)aws_regionTypeValue;
  68. @end
  69. @interface NSFileManager (AWS)
  70. - (BOOL)aws_atomicallyCopyItemAtURL:(NSURL *)sourceURL
  71. toURL:(NSURL *)destinationURL
  72. backupItemName:(NSString *)backupItemName
  73. error:(NSError **)outError;
  74. @end