Resource Base
Table of contents
Notice: This documentation is archived. For the latest product features and documentation, please visit Dynamsoft Capture Vision Documentation.

DSCodeParser Class

The DSCodeParser class enable users to configure the code parser settings or parse the content.

Definition

Assembly: DynamsoftCodeParser.xcframework

  • Objective-C
  • Swift
  1. @interface DSCodeParser : NSObject
    
  2. class CodeParser : NSObject
    

Method Summary

Method Description
init The constructor.
initSettingsFromFile Initialize runtime settings with the settings in a given JSON file.
initSettings Initialize runtime settings with the settings in a given JSON string.
parse Parses code data for readable results.
resetSettings Reset runtime settings to default.

Method Detail

init

Default constructor of a CodeParser object.

  • Objective-C
  • Swift
  1. - (instancetype)init;
    
  2. init()
    

InitSettingsFromFile

Initialize settings from a given file.

  • Objective-C
  • Swift
  1. - (BOOL)initSettingsFromFile:(NSString *)filePath
                       error:(NSError * _Nullable * _Nullable)error;
    
  2. func initSettingsFromFile(_ filePath:String) throws -> BOOL
    

Parameters

filePath: The path of the settings file.

InitSettings

Initialize settings from a given string.

  • Objective-C
  • Swift
  1. - (BOOL)initSettings:(NSString *)content
               error:(NSError * _Nullable * _Nullable)error;
    
  2. func initSettings(_ content:String) throws -> BOOL
    

Parameters

content: A JSON string that represents the content of the settings.

Parse

Parses code data for human-readable results.

  • Objective-C
  • Swift
  1. - (nullable DSParsedResultItem *)parse:(NSData *)bytes
                       taskSettingName:(NSString *)taskSettingName
                                 error:(NSError * _Nullable * _Nullable)error;
    
  2. func parse(_ bytes:Data, taskSettingName:String) throws -> ParsedResultItem
    

Parameters

bytes The array of bytes which contain the code string.

taskSettingNameOptional The name of CodeParserTaskSetting which defines the settings used for code parsing.

Return Value

Returns ParsedResultItem which stores the human-readable results.

ResetSettings

Reset all parameters to default values.

  • Objective-C
  • Swift
  1. - (void)resetSettings;
    
  2. func resetSettings()
    

Is this page helpful?

YesYes NoNo

In this article:

Version 2.2.10

    • version 2.2.10
    • Version 2.x
      • Version 2.2.10
      • Version 2.0.21
      • Version 2.0.20
    Change +