-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTIXboxLiveEngineAdditions.h
94 lines (75 loc) · 3.38 KB
/
TIXboxLiveEngineAdditions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//
// TIXboxLiveEngineAdditions.h
// TIXboxLiveEngine
//
// Created by Tom Irving on 21/10/2010.
// Copyright 2010 Tom Irving. All rights reserved.
//
#import "TIXboxLiveEngineCookieStorage.h"
void dispatch_async_serial(const char * label, dispatch_block_t block);
void dispatch_async_main_queue(dispatch_block_t block);
@interface NSURL (TIXboxLiveEngineAdditions)
- (NSString *)safeBaseURL;
@end
@interface NSMutableURLRequest (TIXboxLiveEngineAdditions)
@property (nonatomic, strong) NSArray * parameters;
- (void)setDefaultsForHash:(NSString *)cookieHash;
@end
@interface NSString (TIXboxLiveEngineAdditions)
@property (nonatomic, readonly) BOOL isNotEmpty;
@property (nonatomic, readonly) NSString * encodedURLString;
@property (nonatomic, readonly) NSString * encodedURLParameterString;
@property (nonatomic, readonly) NSString * decodedURLString;
@property (nonatomic, readonly) NSString * stringByReplacingWeirdEncoding;
@property (nonatomic, readonly) NSString * stringByEscapingXML;
@property (nonatomic, readonly) NSString * stringByUnescapingXML;
@property (nonatomic, readonly) NSString * stringByTrimmingWhitespaceAndNewLines;
@property (nonatomic, readonly) NSString * stringByCorrectingDateRelativeToLocale;
@property (nonatomic, readonly) id objectFromJSONString;
@property (nonatomic, readonly) NSDate * dateFromJSONDate;
@property (nonatomic, readonly) NSString * fileSafeHash;
- (NSString *)stringBetween:(NSString *)start and:(NSString *)end;
- (BOOL)contains:(NSString *)string;
- (NSString *)stringByCorrectingDateRelativeToLocaleWithInputFormatter:(NSDateFormatter *)inputFormatter
outputFormatter:(NSDateFormatter *)outputFormatter;
- (NSString *)stringSignedWithSecret:(NSString *)secret;
@end
@class TIXboxLiveFriend, TIXboxLiveGame, TIXboxLiveMessage;
@interface NSArray (TIXboxLiveEngineAdditions)
- (NSUInteger)indexOfFriendWithGamertag:(NSString *)gamertag;
- (NSUInteger)indexOfMessageWithID:(NSString *)address;
- (NSUInteger)indexOfFriendEqualToFriend:(TIXboxLiveFriend *)aFriend;
- (NSUInteger)indexOfMessageEqualToMessage:(TIXboxLiveMessage *)aMessage;
- (BOOL)containsFriendWithGamertag:(NSString *)gamertag;
- (BOOL)containsMessageWithID:(NSString *)address;
- (BOOL)containsFriendEqualToFriend:(TIXboxLiveFriend *)aFriend;
- (BOOL)containsMessageEqualToMessage:(TIXboxLiveMessage *)aMessage;
- (TIXboxLiveFriend *)friendWithGamertag:(NSString *)gamertag;
- (TIXboxLiveMessage *)messageWithID:(NSString *)messageID;
@end
@interface NSDictionary (TIXboxLiveEngineAdditions)
- (id)safeObjectForKey:(id)key;
@end
@interface NSMutableDictionary (TIXboxLiveEngineAdditions)
- (void)safelySetObject:(id)anObject forKey:(id)aKey;
@end
@interface NSDate (TIXboxLiveEngineAdditions)
- (NSString *)relativeDateString;
- (NSString *)relativeDateStringWithDateFormatter:(NSDateFormatter *)dateFormatter;
- (NSString *)fullDateString;
- (NSString *)fullDateStringWithDateFormatter:(NSDateFormatter *)dateFormatter;
@end
#if TARGET_OS_IPHONE
@interface UIApplication (TIXboxLiveEngineAdditions)
- (void)smartSetNetworkActivityIndicatorVisible:(BOOL)visible;
@end
@interface UIImage (TIXboxLiveEngineAdditions)
- (UIImage *)imageCroppedToRect:(CGRect)rect;
@end
#else
NSData * NSImagePNGRepresentation(NSImage * image);
NSData * NSImageJPEGRepresentation(NSImage * image, CGFloat compression);
@interface NSImage (TIXboxLiveEngineAdditions)
- (NSImage *)imageCroppedToRect:(NSRect)rect;
@end
#endif