ObjFW
OFOpenItemFailedException.h
1 /*
2  * Copyright (c) 2008-2021 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 OFURL;
21 
29 {
30  OFURL *_Nullable _URL;
31  OFString *_Nullable _path;
32  OFString *_mode;
33  int _errNo;
34 }
35 
39 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFURL *URL;
40 
44 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *path;
45 
49 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *mode;
50 
54 @property (readonly, nonatomic) int errNo;
55 
56 + (instancetype)exception OF_UNAVAILABLE;
57 
66 + (instancetype)exceptionWithURL: (OFURL *)URL
67  mode: (nullable OFString *)mode
68  errNo: (int)errNo;
69 
78 + (instancetype)exceptionWithPath: (OFString *)path
79  mode: (nullable OFString *)mode
80  errNo: (int)errNo;
81 
82 - (instancetype)init OF_UNAVAILABLE;
83 
92 - (instancetype)initWithURL: (OFURL *)URL
93  mode: (nullable OFString *)mode
94  errNo: (int)errNo;
95 
104 - (instancetype)initWithPath: (OFString *)path
105  mode: (nullable OFString *)mode
106  errNo: (int)errNo;
107 @end
108 
109 OF_ASSUME_NONNULL_END
The base class for all exceptions in ObjFW.
Definition: OFException.h:147
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:44
OFString * mode
The mode in which the item should have been opened.
Definition: OFOpenItemFailedException.h:49
OFURL * URL
The URL of the item which could not be opened.
Definition: OFOpenItemFailedException.h:39
A class for handling strings.
Definition: OFString.h:132
A class for parsing URLs and accessing parts of it.
Definition: OFURL.h:34