ObjFW
OFOpenItemFailedException.h
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFException.h"
17 
18 OF_ASSUME_NONNULL_BEGIN
19 
20 @class OFIRI;
21 
29 {
30  OFIRI *_Nullable _IRI;
31  OFString *_Nullable _path;
32  OFString *_mode;
33  int _errNo;
34  OF_RESERVE_IVARS(OFOpenItemFailedException, 4)
35 }
36 
40 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFIRI *IRI;
41 
45 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *path;
46 
50 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *mode;
51 
55 @property (readonly, nonatomic) int errNo;
56 
65 + (instancetype)exceptionWithIRI: (OFIRI *)IRI
66  mode: (nullable OFString *)mode
67  errNo: (int)errNo;
68 
77 + (instancetype)exceptionWithPath: (OFString *)path
78  mode: (nullable OFString *)mode
79  errNo: (int)errNo;
80 
81 + (instancetype)exception OF_UNAVAILABLE;
82 
91 - (instancetype)initWithIRI: (OFIRI *)IRI
92  mode: (nullable OFString *)mode
93  errNo: (int)errNo;
94 
103 - (instancetype)initWithPath: (OFString *)path
104  mode: (nullable OFString *)mode
105  errNo: (int)errNo;
106 
107 - (instancetype)init OF_UNAVAILABLE;
108 @end
109 
110 OF_ASSUME_NONNULL_END
The base class for all exceptions in ObjFW.
Definition: OFException.h:151
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition: OFIRI.h:37
An exception indicating an item could not be opened.
Definition: OFOpenItemFailedException.h:29
OFString * path
The path of the item which could not be opened.
Definition: OFOpenItemFailedException.h:45
OFString * mode
The mode in which the item should have been opened.
Definition: OFOpenItemFailedException.h:50
OFIRI * IRI
The IRI of the item which could not be opened.
Definition: OFOpenItemFailedException.h:40
A class for handling strings.
Definition: OFString.h:135