21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
-
-
+
+
+
|
* _writeNBytes:fromBuffer: and _atEndOfStream, but nothing else. Those are not
* defined in the headers, but do the actual work. OFStream uses those and does
* all the caching and other stuff. If you override these methods without the
* _ prefix, you *WILL* break caching and get broken results!
*/
@interface OFStream: OFObject
{
char *cache, *wcache;
size_t cache_len, wcache_len;
BOOL use_wcache;
char *cache, *wbuffer;
size_t cache_len, wbuffer_len;
BOOL use_wbuffer;
}
/**
* Returns a boolean whether the end of the stream has been reached.
*
* \return A boolean whether the end of the stream has been reached
*/
|
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
-
+
-
+
-
+
|
* \return The line that was read, autoreleased, or nil if the end of the
* stream has been reached.
*/
- (OFString*)readTillDelimiter: (OFString*)delimiter
withEncoding: (enum of_string_encoding)encoding;
/**
* Caches all writes until flushWriteCache is called.
* Buffer all writes until flushWriteBuffer is called.
*/
- cacheWrites;
- bufferWrites;
/**
* Writes everything in the write cache to the stream.
*/
- flushWriteCache;
- flushWriteBuffer;
/**
* Writes from a buffer into the stream.
*
* \param buf The buffer from which the data is written to the stream
* \param size The size of the data that should be written
* \return The number of bytes written
|