ObjFW
OFSeekableStream.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License version 3.0 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13  * version 3.0 for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * version 3.0 along with this program. If not, see
17  * <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __STDC_LIMIT_MACROS
21 # define __STDC_LIMIT_MACROS
22 #endif
23 #ifndef __STDC_CONSTANT_MACROS
24 # define __STDC_CONSTANT_MACROS
25 #endif
26 
27 #include "objfw-defs.h"
28 
29 #ifdef OF_HAVE_SYS_TYPES_H
30 # include <sys/types.h>
31 #endif
32 
33 #import "OFStream.h"
34 
35 OF_ASSUME_NONNULL_BEGIN
36 
39 #if defined(OF_WINDOWS)
40 typedef __int64 OFStreamOffset;
41 #elif defined(OF_ANDROID)
42 typedef long long OFStreamOffset;
43 #elif defined(OF_MORPHOS)
44 typedef long long OFStreamOffset;
45 #elif defined(OF_HAVE_OFF64_T)
46 typedef off64_t OFStreamOffset;
47 #else
48 typedef off_t OFStreamOffset;
49 #endif
50 
54 typedef enum {
61 } OFSeekWhence;
62 
75 {
76  OF_RESERVE_IVARS(OFSeekableStream, 4)
77 }
78 
88 - (OFStreamOffset)seekToOffset: (OFStreamOffset)offset
89  whence: (OFSeekWhence)whence;
90 
105 - (OFStreamOffset)lowlevelSeekToOffset: (OFStreamOffset)offset
106  whence: (OFSeekWhence)whence;
107 @end
108 
109 OF_ASSUME_NONNULL_END
OFSeekWhence
From where to seek.
Definition: OFSeekableStream.h:54
A base class for different types of streams.
Definition: OFStream.h:278
Definition: OFSeekableStream.h:56
Definition: OFSeekableStream.h:58
Definition: OFSeekableStream.h:60
A stream that supports seeking.
Definition: OFSeekableStream.h:74