sensitivity.io for iOS & macOS
1.1.4
|
#import <Scanner.h>
Instance Methods | |
(instancetype _Nullable) | - initWithError: |
(BOOL) | - cancelScanWithError: |
(BOOL) | - isCanceled:withError: |
(BOOL) | - scanString:withThreatHandler:withError: |
(BOOL) | - scanData:withThreatHandler:fileName:withError: |
(BOOL) | - scanFileAtPath:withThreatHandler:withError: |
(NSArray< ThreatInfo * > *_Nullable) | - scanString:stopAtFirstThreat:withError: |
(NSArray< ThreatInfo * > *_Nullable) | - scanData:stopAtFirstThreat:fileName:withError: |
(NSArray< ThreatInfo * > *_Nullable) | - scanFileAtPath:stopAtFirstThreat:withError: |
Scanner class provides the means to scan texts, data and files. Before performing any scans the scanner module needs to have its resources initialized, the license needs to be loaded, the scanner needs to be registered with a settings loader and the scanner settings need to be loaded with that settings loader. When cancelling a scanner, it will become invalid, so in order to perform a new scan you need to create a new instance of Scanner.
- (BOOL) cancelScanWithError: | (NSError *_Nullable *_Nullable) | error |
Cancels current scan
error | The error representing the reason for the failure |
- (instancetype _Nullable) initWithError: | (NSError *_Nullable *_Nullable) | error |
Initializes a new object immediately after memory for it has been allocated
error | The error representing the reason for the failure |
- (BOOL) isCanceled: | (BOOL *_Nonnull) | canceled | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Checks if scanner is canceled
canceled | Will be set to the canceled status in case the check was successful |
error | The error representing the reason for the failure |
- (NSArray<ThreatInfo *> * _Nullable) scanData: | (NSData *_Nonnull) | data | |
stopAtFirstThreat: | (BOOL) | stopAtFirst | |
fileName: | (NSString *_Nullable) | fileName | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Scans data for threats.
data | The data that needs to be scanned |
stopAtFirst | If true, the scan will stop on first found threat, otherwise it will scan the whole data |
fileName | If data is the content of a file, pass file name (otherwise it may be nil or empty string) |
error | The error representing the reason for the failure |
- (BOOL) scanData: | (NSData *_Nonnull) | data | |
withThreatHandler: | (ThreatHandler *_Nonnull) | threatHandler | |
fileName: | (NSString *_Nullable) | fileName | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Scans data for threats using threat handler.
data | The data that needs to be scanned |
threatHandler | The threat handler |
fileName | If data is the content of a file, pass file name (otherwise it may be nil or empty string) |
error | The error representing the reason for the failure |
- (NSArray<ThreatInfo *> * _Nullable) scanFileAtPath: | (NSString *_Nonnull) | filePath | |
stopAtFirstThreat: | (BOOL) | stopAtFirst | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Scans file for threats.
filePath | The path of the file that needs to be scanned |
stopAtFirst | If true, the scan will stop on first found threat, otherwise it will scan the whole file |
error | The error representing the reason for the failure |
- (BOOL) scanFileAtPath: | (NSString *_Nonnull) | filePath | |
withThreatHandler: | (ThreatHandler *_Nonnull) | threatHandler | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Scans file for threats using threat handler.
filePath | The path of the file that needs to be scanned |
threatHandler | The threat handler |
error | The error representing the reason for the failure |
- (NSArray<ThreatInfo *> * _Nullable) scanString: | (NSString *_Nonnull) | text | |
stopAtFirstThreat: | (BOOL) | stopAtFirst | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Scans provided text for threats.
text | The text to scan |
stopAtFirst | If true, the scan will stop on first found threat, otherwise it will scan the whole string |
error | The error representing the reason for the failure |
- (BOOL) scanString: | (NSString *_Nonnull) | text | |
withThreatHandler: | (ThreatHandler *_Nonnull) | threatHandler | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Scans provided text for threats using threat handler.
text | The text to scan |
threatHandler | The threat handler |
error | The error representing the reason for the failure |