ObjFW  Diff

Differences From Artifact [38bd04ae73]:

To Artifact [56eb0b9d36]:


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFStream.h"

/**
 * \brief A stream that supports seeking.
 *
 * \note If you want to subclass this, override lowlevelSeekToOffset:,
 *	 lowlevelSeekForwardWithOffset: and lowlevelSeekToOffsetRelativeToEnd:,
 *	 but nothing else. Those are not defined in the headers, but do the
 *	 actual work. OFSeekableStream uses those and makes them work together
 *	 with the caching of OFStream. If you override these methods without
 *	 the lowlevel prefix, you <i>will</i> break caching, get broken results
 *	 and seek to the wrong position!
 */
@interface OFSeekableStream: OFStream
/**
 * \brief Seeks to the specified absolute offset.
 *
 * \param offset The offset in bytes
 */
- (void)seekToOffset: (off_t)offset;

/**
 * \brief Seeks to the specified offset, relative to the current location.
 *
 * \param offset The offset relative to the current location
 * \return The absolute offset
 */
- (off_t)seekForwardWithOffset: (off_t)offset;

/**
 * \brief Seeks to the specified offset, relative to the end of the stream.
 *
 * \param offset The offset relative to the end of the stream
 * \return The absolute offset
 */
- (off_t)seekToOffsetRelativeToEnd: (off_t)offset;

/**
 * \brief Seek the stream on the lowlevel.
 *
 * \warning Do not call this directly!
 *
 * Override this with this method with your actual seek implementation when
 * subclassing!
 *
 * \param offset The offset to seek to
 */
- (void)lowlevelSeekToOffset: (off_t)offset;

/**
 * \brief Seek the stream on the lowlevel.
 *
 * \warning Do not call this directly!
 *
 * Override this with this method with your actual seek implementation when
 * subclassing!
 *
 * \param offset The offset to seek forward to
 */
- (off_t)lowlevelSeekForwardWithOffset: (off_t)offset;

/**
 * \brief Seek the stream on the lowlevel.
 *
 * \warning Do not call this directly!
 *
 * Override this with this method with your actual seek implementation when
 * subclassing!
 *
 * \param offset The offset to seek to, relative to the end
 */
- (off_t)lowlevelSeekToOffsetRelativeToEnd: (off_t)offset;
@end







|
|

|








|
|

|



|
|

|
|



|
|

|
|



|
|

|




|



|
|

|




|



|
|

|




|



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFStream.h"

/*!
 * @brief A stream that supports seeking.
 *
 * @note If you want to subclass this, override lowlevelSeekToOffset:,
 *	 lowlevelSeekForwardWithOffset: and lowlevelSeekToOffsetRelativeToEnd:,
 *	 but nothing else. Those are not defined in the headers, but do the
 *	 actual work. OFSeekableStream uses those and makes them work together
 *	 with the caching of OFStream. If you override these methods without
 *	 the lowlevel prefix, you <i>will</i> break caching, get broken results
 *	 and seek to the wrong position!
 */
@interface OFSeekableStream: OFStream
/*!
 * @brief Seeks to the specified absolute offset.
 *
 * @param offset The offset in bytes
 */
- (void)seekToOffset: (off_t)offset;

/*!
 * @brief Seeks to the specified offset, relative to the current location.
 *
 * @param offset The offset relative to the current location
 * @return The absolute offset
 */
- (off_t)seekForwardWithOffset: (off_t)offset;

/*!
 * @brief Seeks to the specified offset, relative to the end of the stream.
 *
 * @param offset The offset relative to the end of the stream
 * @return The absolute offset
 */
- (off_t)seekToOffsetRelativeToEnd: (off_t)offset;

/*!
 * @brief Seek the stream on the lowlevel.
 *
 * @warning Do not call this directly!
 *
 * Override this with this method with your actual seek implementation when
 * subclassing!
 *
 * @param offset The offset to seek to
 */
- (void)lowlevelSeekToOffset: (off_t)offset;

/*!
 * @brief Seek the stream on the lowlevel.
 *
 * @warning Do not call this directly!
 *
 * Override this with this method with your actual seek implementation when
 * subclassing!
 *
 * @param offset The offset to seek forward to
 */
- (off_t)lowlevelSeekForwardWithOffset: (off_t)offset;

/*!
 * @brief Seek the stream on the lowlevel.
 *
 * @warning Do not call this directly!
 *
 * Override this with this method with your actual seek implementation when
 * subclassing!
 *
 * @param offset The offset to seek to, relative to the end
 */
- (off_t)lowlevelSeekToOffsetRelativeToEnd: (off_t)offset;
@end