Parser#

Defined in framework ScanditDataParser

SDCParser#
@interface SDCParser : NSObject <SDCDataCaptureComponent>

Added in version 6.1.0

+ parserForContext:format:error:#
+ (nullable instancetype)parserForContext:(nonnull SDCDataCaptureContext *)context
                                   format:(SDCParserDataFormat)dataFormat
                                    error:(NSError **)error

Added in version 6.1.0

Create new parser for the provided data format and context. The license key with which the data capture context was constructed must have the parser feature enabled.

In case the parser could not be created, more detailed information on why creation failed is stored in the error argument, if non-nil.

+ parserFromJSONString:context:error:#
+ (nullable instancetype)parserFromJSONString:(nonnull NSString *)JSONString
                                      context:(nonnull SDCDataCaptureContext *)context
                                        error:(NSError **)error

Added in version 6.3.0

Construct a new parser with the provided JSON serialization. See Serialization for details.

- parseString:error:#
- (nullable SDCParsedData *)parseString:(NSString *)string
                                  error:(NSError **)error

Added in version 6.1.0

Parses the data string and returns the contained field in the result object. Typical inputs to this method is the data contained in a barcode (see SDCBarcode.data)

In case the data string could not be parsed, the error message is contained in the error parameter.

- parseRawData:error:#
- (nullable SDCParsedData *)parseRawData:(NSData *)data
                                   error:(NSError **)error

Added in version 6.1.0

Parses the raw data and returns the contained field in the result object. Typical inputs to this method is the raw data of a barcode (see SDCBarcode.rawData).

In case the data string could not be parsed, the error message is contained in the error parameter.

- setOptions:error:#
- (BOOL)setOptions:(NSDictionary<NSString *, NSObject *> *)options
             error:(NSError **)error

Added in version 6.1.0

Set the provided options on the parser.

Available options depend on the data format type of the parser and are documented for each of the supported data formats.

In case the options are invalid, this method returns NO and the error argument is filled with more information on the failure.

- updateFromJSONString:error:#
- (BOOL)updateFromJSONString:(nonnull NSString *)JSONString
                       error:(NSError **)error

Added in version 6.3.0

Updates the parser according to a JSON serialization. See Serialization for details.