ObjFW
OFSeekFailedException.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 #import "OFSeekableStream.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
28 {
29  OFSeekableStream *_stream;
30  of_offset_t _offset;
31  int _whence, _errNo;
32 }
33 
37 @property (readonly, nonatomic) OFSeekableStream *stream;
38 
42 @property (readonly, nonatomic) of_offset_t offset;
43 
47 @property (readonly, nonatomic) int whence;
48 
52 @property (readonly, nonatomic) int errNo;
53 
54 + (instancetype)exception OF_UNAVAILABLE;
55 
65 + (instancetype)exceptionWithStream: (OFSeekableStream *)stream
66  offset: (of_offset_t)offset
67  whence: (int)whence
68  errNo: (int)errNo;
69 
70 - (instancetype)init OF_UNAVAILABLE;
71 
81 - (instancetype)initWithStream: (OFSeekableStream *)stream
82  offset: (of_offset_t)offset
83  whence: (int)whence
84  errNo: (int)errNo OF_DESIGNATED_INITIALIZER;
85 @end
86 
87 OF_ASSUME_NONNULL_END
The base class for all exceptions in ObjFW.
Definition: OFException.h:147
An exception indicating that seeking in a stream failed.
Definition: OFSeekFailedException.h:28
A stream that supports seeking.
Definition: OFSeekableStream.h:57