ObjFW  Diff

Differences From Artifact [c7b337bee8]:

To Artifact [3161b39141]:


130
131
132
133
134
135
136
137


138
139
140
141
142


143
144
145
146
147
148
149
130
131
132
133
134
135
136

137
138
139
140
141
142

143
144
145
146
147
148
149
150
151







-
+
+




-
+
+







 *		 data has been received. If the method returns YES, it will be
 *		 called again with the same buffer and maximum length when more
 *		 data has been received. If you want the next method in the
 *		 queue to handle the data received next, you need to return NO
 *		 from the method.
 * @param selector The selector to call on the target. The signature must be
 *		   BOOL (OFStream *stream, void *buffer, size_t size,
 *		   OFException *exception).
 *		   id context, OFException *exception).
 * @param context A context to pass when the target gets called
 */
- (void)asyncReadIntoBuffer: (void*)buffer
		     length: (size_t)length
		     target: (id)target
		   selector: (SEL)selector;
		   selector: (SEL)selector
		    context: (id)context;

/*!
 * @brief Asyncronously reads exactly the specified length bytes from the
 *	  stream into a buffer.
 *
 * Unlike @ref asyncReadIntoBuffer:length:block, this method does not call the
 * method when less than the specified length has been read - instead, it waits
157
158
159
160
161
162
163
164


165
166
167
168
169


170
171
172
173
174
175
176
159
160
161
162
163
164
165

166
167
168
169
170
171

172
173
174
175
176
177
178
179
180







-
+
+




-
+
+







 *		 data has been received. If the method returns YES, it will be
 *		 called again with the same buffer and exact length when more
 *		 data has been received. If you want the next method in the
 *		 queue to handle the data received next, you need to return NO
 *		 from the method.
 * @param selector The selector to call on the target. The signature must be
 *		   BOOL (OFStream *stream, void *buffer, size_t size,
 *		   OFException *exception).
 *		   id context, OFException *exception).
 * @param context A context to pass when the target gets called
 */
 - (void)asyncReadIntoBuffer: (void*)buffer
		 exactLength: (size_t)length
		      target: (id)target
		    selector: (SEL)selector;
		    selector: (SEL)selector
		     context: (id)context;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Asyncronously reads <i>at most</i> size bytes from the stream into a
 *	  buffer.
 *
 * On network streams, this might read less than the specified number of bytes.
568
569
570
571
572
573
574
575

576

577
578
579


580
581
582
583
584
585
586
587
588
589
590
591
592

593

594
595
596
597


598
599
600
601
602
603
604
572
573
574
575
576
577
578

579
580
581
582
583

584
585
586
587
588
589
590
591
592
593
594
595
596
597

598
599
600
601
602
603

604
605
606
607
608
609
610
611
612







-
+

+


-
+
+












-
+

+



-
+
+







 *
 * @param target The target on which to call the selector when the data has
 *		 been received. If the method returns YES, it will be called
 *		 again when the next line has been received. If you want the
 *		 next method in the queue to handle the next line, you need to
 *		 return NO from the method
 * @param selector The selector to call on the target. The signature must be
 *		   BOOL (OFStream *stream, OFString *line,
 *		   BOOL (OFStream *stream, OFString *line, id context,
 *		   OFException *exception).
 * @param context A context to pass when the target gets called
 */
- (void)asyncReadLineWithTarget: (id)target
		       selector: (SEL)selector;
		       selector: (SEL)selector
			context: (id)context;

/*!
 * @brief Asyncronously reads with the specified encoding until a newline, \\0,
 *	  end of stream or an exception occurs.
 *
 * @param encoding The encoding used by the stream
 * @param target The target on which to call the selector when the data has
 *		 been received. If the method returns YES, it will be called
 *		 again when the next line has been received. If you want the
 *		 next method in the queue to handle the next line, you need to
 *		 return NO from the method
 * @param selector The selector to call on the target. The signature must be
 *		   BOOL (OFStream *stream, OFString *line,
 *		   BOOL (OFStream *stream, OFString *line, id context,
 *		   OFException *exception).
 * @param context A context to pass when the target gets called
 */
- (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding
			   target: (id)target
			 selector: (SEL)selector;
			 selector: (SEL)selector
			  context: (id)context;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief Asyncronously reads until a newline, \\0, end of stream or an
 *	  exception occurs.
 *
 * @param block The block to call when the data has been received.