pEpObjCAdapter/NSError+PEP+Internal.h
author Dirk Zimmermann <dz@pep.security>
Wed, 20 Mar 2019 16:40:35 +0100
branchIOS-1480
changeset 902 32760267cd59
parent 848 fcc04485e31f
permissions -rw-r--r--
IOS-1480 Avoid framework imports.
dz@831
     1
//
dz@831
     2
//  NSError+PEP+Internal.h
dz@831
     3
//  pEpObjCAdapter
dz@831
     4
//
dz@831
     5
//  Created by Dirk Zimmermann on 28.02.19.
dz@831
     6
//  Copyright © 2019 p≡p. All rights reserved.
dz@831
     7
//
dz@831
     8
dz@831
     9
#ifndef NSError_PEP_Internal_h
dz@831
    10
#define NSError_PEP_Internal_h
dz@831
    11
dz@902
    12
#import "PEPEngineTypes.h"
dz@848
    13
dz@831
    14
/**
dz@831
    15
 Extension for creating `NSError`s from `PEP_STATUS`
dz@831
    16
 */
dz@831
    17
@interface NSError (Internal)
dz@831
    18
dz@831
    19
+ (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status
dz@831
    20
                                userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict;
dz@831
    21
dz@831
    22
+ (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status;
dz@831
    23
dz@831
    24
+ (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status
dz@831
    25
                                        userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict;
dz@831
    26
dz@831
    27
+ (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status;
dz@831
    28
dz@831
    29
/**
dz@831
    30
 If the given status indicates an error, tries to set the given error accordingly.
dz@831
    31
 @return YES if the given status indicates an error condition, NO otherwise.
dz@831
    32
 */
dz@831
    33
+ (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatusInternal:(PEP_STATUS)status;
dz@831
    34
dz@831
    35
/**
dz@831
    36
 If the given status indicates an error, tries to set the given error accordingly.
dz@831
    37
 @return YES if the given status indicates an error condition, NO otherwise.
dz@831
    38
 */
dz@831
    39
+ (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatus:(PEPStatus)status;
dz@831
    40
dz@831
    41
@end
dz@831
    42
dz@831
    43
#endif /* NSError_PEP_Internal_h */