JubeatPlus 3.9.11
Loading...
Searching...
No Matches
CJSONScanner.h
Go to the documentation of this file.
1
13
14#import <Foundation/Foundation.h>
15
16NS_ASSUME_NONNULL_BEGIN
17
26@interface CDataScanner : NSObject {
27@protected
28 char *current;
29 char *end;
30}
31
36- (void)setData:(nullable NSData *)data;
48- (unichar)scanCharacter;
54- (BOOL)scanCharacter:(unichar)character;
61- (BOOL)scanUTF8String:(const char *)string intoString:(NSString *_Nullable *_Nullable)outString;
67- (BOOL)scanNumber:(NSNumber *_Nullable *_Nullable)outNumber;
72- (NSUInteger)scanLocation;
77- (void)setScanLocation:(NSUInteger)location;
82- (NSDictionary *)userInfoForScanLocation;
83
84@end
85
90
94@property(nonatomic, strong, nullable) id nullObject;
95
99@property(nonatomic) NSUInteger allowedEncoding;
100
105@property(nonatomic) NSUInteger options;
106
110@property(nonatomic) BOOL strictEscapeCodes;
111
116+ (void)initialize;
117
123- (instancetype)init;
124
132- (BOOL)setData:(nullable NSData *)data error:(NSError *_Nullable *_Nullable)outError;
133
139- (void)setData:(nullable NSData *)data;
140
148- (BOOL)scanJSONObject:(id _Nullable *_Nullable)outObject
149 error:(NSError *_Nullable *_Nullable)outError;
150
158- (BOOL)scanJSONDictionary:(NSDictionary *_Nullable *_Nullable)outDictionary
159 error:(NSError *_Nullable *_Nullable)outError;
160
168- (BOOL)scanJSONArray:(NSArray *_Nullable *_Nullable)outArray
169 error:(NSError *_Nullable *_Nullable)outError;
170
178- (BOOL)scanJSONStringConstant:(NSString *_Nullable *_Nullable)outString
179 error:(NSError *_Nullable *_Nullable)outError;
180
188- (BOOL)scanJSONNumberConstant:(NSNumber *_Nullable *_Nullable)outNumber
189 error:(NSError *_Nullable *_Nullable)outError;
190
197- (BOOL)scanNotQuoteCharactersIntoString:(NSString *_Nullable *_Nullable)outString;
198
207- (NSError *)error:(NSInteger)code description:(NSString *)description;
208
209@end
210
211NS_ASSUME_NONNULL_END
212
213// code: language=Objective-C
214// kate: hl Objective-C;
215// vim: set ft=objc :
A byte-oriented scanner over an NSData 's bytes.
Definition CDataScanner.h:26
char * end
One past the last byte of the input.
Definition CDataScanner.h:30
NSUInteger scanLocation
The cursor's byte offset from the start of the data.
Definition CDataScanner.m:69
unichar currentCharacter()
The character at the cursor without consuming it.
Definition CDataScanner.m:111
void skipWhitespace()
Advances the cursor past any whitespace.
Definition CDataScanner.m:305
unichar scanCharacter()
Consumes and returns the character at the cursor.
Definition CDataScanner.m:116
char * current
The next byte the scanner will read.
Definition CDataScanner.h:31
NSDictionary * userInfoForScanLocation()
Diagnostic user info describing where the cursor is: its line, column, offset, and a snippet marking ...
Definition CDataScanner.m:390
Scans JSON text into Foundation objects.
Definition CJSONScanner.h:90
instancetype init()
Builds a scanner with no null object substitution and non-strict escapes.
Definition CJSONScanner.m:112
id nullObject
What a JSON null becomes.
Definition CJSONScanner.h:94
NSUInteger options
Scanning options.
Definition CJSONScanner.h:105
void initialize()
Primes the shared boxed YES and NO the scanner returns for true and false .
Definition CJSONScanner.m:100
NSUInteger allowedEncoding
Which text encoding the input is allowed to be in, tried after the BOM sniff fails.
Definition CJSONScanner.h:99
BOOL strictEscapeCodes
Whether an unrecognised backslash escape is an error rather than a literal character.
Definition CJSONScanner.h:110