|
JubeatPlus 3.9.11
|
Scans JSON text into Foundation objects. More...
#include <CJSONScanner.h>


Instance Methods | |
| (instancetype) | - init |
| Builds a scanner with no null object substitution and non-strict escapes. | |
| (BOOL) | - setData:error: |
| Points the scanner at some JSON text, sniffing its encoding and re-encoding it to UTF-8. | |
| (void) | - setData: |
| Points the scanner at some JSON text, discarding any encoding failure. | |
| (BOOL) | - scanJSONObject:error: |
| Scans whatever the text describes, dispatching on the first non-space character. | |
| (BOOL) | - scanJSONDictionary:error: |
| Scans, requiring a dictionary. | |
| (BOOL) | - scanJSONArray:error: |
| Scans, requiring an array. | |
| (BOOL) | - scanJSONStringConstant:error: |
| Scans a quoted JSON string, decoding its backslash escapes. | |
| (BOOL) | - scanJSONNumberConstant:error: |
| Scans a JSON number literal. | |
| (BOOL) | - scanNotQuoteCharactersIntoString: |
| Consumes the run of characters up to the next quote or backslash. | |
| (NSError *) | - error:description: |
Builds an NSError in the scanner's domain, with a description and the cursor's user info. | |
| Instance Methods inherited from CDataScanner | |
| (instancetype) | - initWithData: |
| Initialises the scanner and points it at some bytes. | |
| (unichar) | - currentCharacter |
| The character at the cursor without consuming it. | |
| (unichar) | - scanCharacter |
| Consumes and returns the character at the cursor. | |
| (BOOL) | - scanCharacter: |
| Consumes the cursor character when it matches. | |
| (BOOL) | - scanUTF8String:intoString: |
| Consumes a fixed UTF-8 run, optionally returning it as a string. | |
| (BOOL) | - scanString:intoString: |
| Consumes a fixed string, optionally returning it. | |
| (BOOL) | - scanCharactersFromSet:intoString: |
| Consumes the run of characters that are members of a set. | |
| (BOOL) | - scanUpToString:intoString: |
| Consumes everything up to the next occurrence of a string. | |
| (BOOL) | - scanUpToCharactersFromSet:intoString: |
| Consumes everything up to the next character that is a member of a set. | |
| (BOOL) | - scanNumber: |
| Consumes a number literal, decoding it to an integer or a decimal. | |
| (BOOL) | - scanDecimalNumber: |
Consumes a number literal, always decoding it to an NSDecimalNumber . | |
| (BOOL) | - scanDataOfLength:intoPointer: |
| Consumes a fixed number of bytes, returning a pointer into the data. | |
| (BOOL) | - scanDataOfLength:intoData: |
Consumes a fixed number of bytes, returning them as an NSData . | |
| (void) | - skipWhitespace |
| Advances the cursor past any whitespace. | |
| (nullable NSString *) | - remainingString |
| The bytes from the cursor to the end, decoded as a UTF-8 string. | |
| (NSData *) | - remainingData |
| The bytes from the cursor to the end. | |
| (BOOL) | - scanCStyleComment: |
| Consumes a C-style block comment (slash-star to star-slash). | |
| (BOOL) | - scanCPlusPlusStyleComment: |
Consumes a C++-style // comment through to the end of the line. | |
| (NSUInteger) | - lineOfScanLocation |
| The one-based-ish count of line breaks before the cursor. | |
| (NSDictionary *) | - userInfoForScanLocation |
| Diagnostic user info describing where the cursor is: its line, column, offset, and a snippet marking the position. | |
| (void) | - skipWhitespace |
| Advances past any whitespace at the cursor. | |
| (unichar) | - currentCharacter |
| The character at the cursor without consuming it. | |
| (unichar) | - scanCharacter |
| Consumes and returns the character at the cursor. | |
| (BOOL) | - scanCharacter: |
| Consumes the cursor character when it matches. | |
| (BOOL) | - scanUTF8String:intoString: |
| Consumes a fixed UTF-8 run, optionally returning it. | |
| (BOOL) | - scanNumber: |
| Consumes a JSON number literal. | |
| (NSUInteger) | - scanLocation |
| The current byte offset. | |
| (void) | - setScanLocation: |
| Rewinds or advances the cursor to a byte offset. | |
| (NSDictionary *) | - userInfoForScanLocation |
| Diagnostic user-info describing where the cursor is. | |
Class Methods | |
| (void) | + initialize |
Primes the shared boxed YES and NO the scanner returns for true and false . | |
Properties | |
| id | nullObject |
What a JSON null becomes. | |
| NSUInteger | allowedEncoding |
| Which text encoding the input is allowed to be in, tried after the BOM sniff fails. | |
| NSUInteger | options |
| Scanning options. | |
| BOOL | strictEscapeCodes |
| Whether an unrecognised backslash escape is an error rather than a literal character. | |
| Properties inherited from CDataScanner | |
| NSUInteger | scanLocation |
| The cursor's byte offset from the start of the data. | |
| NSUInteger | bytesRemaining |
| The number of bytes between the cursor and the end of the data. | |
| BOOL | isAtEnd |
| Whether the cursor has reached or passed the end of the data. | |
Additional Inherited Members | |
| Protected Attributes inherited from CDataScanner | |
| NSData * | data |
| The bytes being scanned; retained. | |
| char * | start |
| The first byte of the input. | |
| char * | end |
| One past the last byte of the input. | |
| char * | current |
| The next byte the scanner will read. | |
| NSUInteger | length |
The byte count of data . | |
Scans JSON text into Foundation objects.
| - (NSError *) error: | (NSInteger) | code | |
| description: | (NSString *) | description |
Builds an NSError in the scanner's domain, with a description and the cursor's user info.
| code | The error code. |
| description | The localised description. |
| - (instancetype) init |
Builds a scanner with no null object substitution and non-strict escapes.
Implements CDataScanner.
| + (void) initialize |
Primes the shared boxed YES and NO the scanner returns for true and false .
Implements CDataScanner.
| - (BOOL) scanJSONArray: | (NSArray *_Nullable *_Nullable) | outArray | |
| error: | (NSError *_Nullable *_Nullable) | outError |
Scans, requiring an array.
| outArray | Where to put the result. |
| outError | Where to report a failure. |
| - (BOOL) scanJSONDictionary: | (NSDictionary *_Nullable *_Nullable) | outDictionary | |
| error: | (NSError *_Nullable *_Nullable) | outError |
Scans, requiring a dictionary.
| outDictionary | Where to put the result. |
| outError | Where to report a failure. |
| - (BOOL) scanJSONNumberConstant: | (NSNumber *_Nullable *_Nullable) | outNumber | |
| error: | (NSError *_Nullable *_Nullable) | outError |
Scans a JSON number literal.
| outNumber | Where to put the result. |
| outError | Where to report a failure. |
| - (BOOL) scanJSONObject: | (id _Nullable *_Nullable) | outObject | |
| error: | (NSError *_Nullable *_Nullable) | outError |
Scans whatever the text describes, dispatching on the first non-space character.
| outObject | Where to put the result. |
| outError | Where to report a failure. |
| - (BOOL) scanJSONStringConstant: | (NSString *_Nullable *_Nullable) | outString | |
| error: | (NSError *_Nullable *_Nullable) | outError |
Scans a quoted JSON string, decoding its backslash escapes.
| outString | Where to put the result. |
| outError | Where to report a failure. |
| - (BOOL) scanNotQuoteCharactersIntoString: | (NSString *_Nullable *_Nullable) | outString |
Consumes the run of characters up to the next quote or backslash.
| outString | Where to put the run, when the caller wants it. |
| - (void) setData: | (nullable NSData *) | data |
Points the scanner at some JSON text, discarding any encoding failure.
| data | The text. |
Implements CDataScanner.
| - (BOOL) setData: | (nullable NSData *) | data | |
| error: | (NSError *_Nullable *_Nullable) | outError |
Points the scanner at some JSON text, sniffing its encoding and re-encoding it to UTF-8.
| data | The text. |
| outError | Where to report a failure. |
|
readwritenonatomicassign |
Scanning options.
Bit 0 keeps scanned containers mutable; bit 1 keeps scanned strings mutable. Both are otherwise copied to immutable.