ObjFW
OFSeekFailedException.h
1 /*
2  * Copyright (c) 2008-2023 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 #import "OFSeekableStream.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
28 {
29  OFSeekableStream *_stream;
30  OFStreamOffset _offset;
31  OFSeekWhence _whence;
32  int _errNo;
33  OF_RESERVE_IVARS(OFSeekFailedException, 4)
34 }
35 
39 @property (readonly, nonatomic) OFSeekableStream *stream;
40 
44 @property (readonly, nonatomic) OFStreamOffset offset;
45 
49 @property (readonly, nonatomic) OFSeekWhence whence;
50 
54 @property (readonly, nonatomic) int errNo;
55 
65 + (instancetype)exceptionWithStream: (OFSeekableStream *)stream
66  offset: (OFStreamOffset)offset
67  whence: (OFSeekWhence)whence
68  errNo: (int)errNo;
69 
70 + (instancetype)exception OF_UNAVAILABLE;
71 
81 - (instancetype)initWithStream: (OFSeekableStream *)stream
82  offset: (OFStreamOffset)offset
83  whence: (OFSeekWhence)whence
84  errNo: (int)errNo OF_DESIGNATED_INITIALIZER;
85 
86 - (instancetype)init OF_UNAVAILABLE;
87 @end
88 
89 OF_ASSUME_NONNULL_END
OFSeekWhence
From where to seek.
Definition: OFSeekableStream.h:50
The base class for all exceptions in ObjFW.
Definition: OFException.h:151
An exception indicating that seeking in a stream failed.
Definition: OFSeekFailedException.h:28
A stream that supports seeking.
Definition: OFSeekableStream.h:71