14#import <Foundation/Foundation.h>
16NS_ASSUME_NONNULL_BEGIN
36- (void)setData:(nullable NSData *)data;
61- (BOOL)scanUTF8String:(const
char *)string intoString:(NSString *_Nullable *_Nullable)outString;
67- (BOOL)scanNumber:(NSNumber *_Nullable *_Nullable)outNumber;
77- (void)setScanLocation:(NSUInteger)location;
132- (BOOL)setData:(nullable NSData *)data error:(NSError *_Nullable *_Nullable)outError;
139- (void)setData:(nullable NSData *)data;
148- (BOOL)scanJSONObject:(
id _Nullable *_Nullable)outObject
149 error:(NSError *_Nullable *_Nullable)outError;
158- (BOOL)scanJSONDictionary:(NSDictionary *_Nullable *_Nullable)outDictionary
159 error:(NSError *_Nullable *_Nullable)outError;
168- (BOOL)scanJSONArray:(NSArray *_Nullable *_Nullable)outArray
169 error:(NSError *_Nullable *_Nullable)outError;
178- (BOOL)scanJSONStringConstant:(NSString *_Nullable *_Nullable)outString
179 error:(NSError *_Nullable *_Nullable)outError;
188- (BOOL)scanJSONNumberConstant:(NSNumber *_Nullable *_Nullable)outNumber
189 error:(NSError *_Nullable *_Nullable)outError;
197- (BOOL)scanNotQuoteCharactersIntoString:(NSString *_Nullable *_Nullable)outString;
207- (NSError *)error:(NSInteger)code description:(NSString *)description;
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