ObjFW
OFUndefinedKeyException.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 
28 {
29  id _object;
30  OFString *_key;
31  id _Nullable _value;
32 }
33 
37 @property (readonly, nonatomic) id object;
38 
42 @property (readonly, nonatomic) OFString *key;
43 
47 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) id value;
48 
49 + (instancetype)exception OF_UNAVAILABLE;
50 
59 + (instancetype)exceptionWithObject: (id)object key: (OFString *)key;
60 
70 + (instancetype)exceptionWithObject: (id)object
71  key: (OFString *)key
72  value: (nullable id)value;
73 
74 - (instancetype)init OF_UNAVAILABLE;
75 
84 - (instancetype)initWithObject: (id)object key: (OFString *)key;
85 
95 - (instancetype)initWithObject: (id)object
96  key: (OFString *)key
97  value: (nullable id)value OF_DESIGNATED_INITIALIZER;
98 @end
99 
100 OF_ASSUME_NONNULL_END
The base class for all exceptions in ObjFW.
Definition: OFException.h:147
A class for handling strings.
Definition: OFString.h:132
An exception indicating that a key is undefined (e.g. for Key Value Coding).
Definition: OFUndefinedKeyException.h:28